#include<stdio.h>
#include<math.h>
int main()
{
float a,b,c;
while(scanf("%f%f%f",&a,&b,&c)!= EOF)
{
float p,s;
p=(a+b+c)/2;
s=sqrt(p*(p-a)*(p-b)*(p-c));
printf("%.3f\n",s);
}
return 0;
}
此题中,要注意“三个整数”不是题意,题目要求是浮点数float;
本题采用海伦公式:p=(a+b+c)/2 ;s=根号下p*(p-a)(p-b)(p-c);需要调用sqrt()函数。