帮我看看这个求三角形面积的C程序哪错了#include#includeint main(void){double a,b,c,s,area,perimeter;printf("Enter 3 sides of the triangle:");scanf("%lf,%lf,%lf\n",&a,b,c);s=(a+b+c)/2;if((a+b>c)&&(a+c>b)&&(b+c>a)){area=sqrt(s*(s-a)*(s-
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/24 02:42:54
帮我看看这个求三角形面积的C程序哪错了#include#includeint main(void){double a,b,c,s,area,perimeter;printf("Enter 3 sides of the triangle:");scanf("%lf,%lf,%lf\n",&a,b,c);s=(a+b+c)/2;if((a+b>c)&&(a+c>b)&&(b+c>a)){area=sqrt(s*(s-a)*(s-
帮我看看这个求三角形面积的C程序哪错了
#include
#include
int main(void)
{
double a,b,c,s,area,perimeter;
printf("Enter 3 sides of the triangle:");
scanf("%lf,%lf,%lf\n",&a,b,c);
s=(a+b+c)/2;
if((a+b>c)&&(a+c>b)&&(b+c>a))
{area=sqrt(s*(s-a)*(s-b)*(s-c));
perimeter=a+b+c;
printf("area=%.2f;perimeter=%.2f\n",&area,perimeter);}
else
printf("Three sides do not correspond to a valid triangle\n");
return 0;
}
帮我看看这个求三角形面积的C程序哪错了#include#includeint main(void){double a,b,c,s,area,perimeter;printf("Enter 3 sides of the triangle:");scanf("%lf,%lf,%lf\n",&a,b,c);s=(a+b+c)/2;if((a+b>c)&&(a+c>b)&&(b+c>a)){area=sqrt(s*(s-a)*(s-
scanf("%lf,%lf,%lf\n",&a,b,c);
应该改为&a&b&c;
scanf("%lf,%lf,%lf\n",&a&b&c);