[求助]帮我看看哪里错拉,
#include "stdio.h"#include "math.h"
void main()
{
double a,b,c, s,
double area;
printf("please inpute three legs\n");
scanf("%lf,%lf,%lf\n", &a,&b,&c);
s=(a+b+c)/2;
area=sqrt(s*(s-a)*(s-b)*(s-c));
printf("the area of triangle is %lf\n", area);
}
求三角形面积.编译能通过,得不到结果啊.
显示为:
please inpute three legs
3 4 5
sqrt: DOMAIN error
the area of triangle is +NAN