你用到了函数sqrt,这个需要有头文件math.h
在最上面加上#include 再运行就可以了,即为:
#include
#include
#define s ((a+b+c)/2)
void main()
{
float a,b,c;
double area;
scanf("%f%f%f",&a,&b,&c);
if(a>=b+c || b>=a+c || c>=a+b)
printf("errorn");
else
{
area=sqrt((double)(s*(s-a)*(s-b)*(s-c)));
printf("%fn",area);
}
}
我调试过,可以正常运行.