> 其他 >
用C语言编写一个程序 其功能是根据三角形的三边长,求三角形的面积.要用main函数
人气:157 ℃ 时间:2020-05-21 00:05:00
解答
#include#includemain{int a,b,c;int p,s;scanf("%d%d%d",&a,&b,&c);p=(a+b+c)/2;if (a+b>c && a+c>b& & b+c>a){s=sqrt(p*(p-a)*(p-b)*(p-c));printf("The area of a triangle is%d",s);}elseprint("Three edges do ...
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版