第1个回答 推荐于2018-03-13
#include<stdio.h>
#include<math.h>
int main()
{
double a, b, c, p, s;
printf("请输入三角形的三边长:");
scanf("%lf%lf%lf", &a, &b, &c);
p = (a+b+c)/2;
s = sqrt( p*(p-a)*(p-b)*(p-c));
printf("%.3f\n", s);
return 0;
}本回答被网友采纳
第2个回答 2016-10-13
#include<stdio.h>
#include<math.h>
main()
{
float a, b, c, p, s;
printf("please input a,b,c:");
scanf("%f%f%f", &a, &b, &c);
p = (a+b+c)/2.0;
s = sqrt( p*(p-a)*(p-b)*(p-c));
printf("s=%f\n", s);
}