帮忙看一下,哪里出错
# include <stdio.h>
# include <math.h>
# include <stdlib.h>
void main()
{
double delta_area(double x, double y, double z); //声明三角形面积函数
double side1,side2,side3;
scanf("%f%f%f",&side1,&side2,&side3);
if((side1+side2)<=side3 || (side2+side3)<=side1 || (side1+side3)<=side2)
{
printf("三条边的长度不能组成三角形:\n");
printf("\a\n");
system("pause");
exit(0);
}
printf(" 三角的面积为:%0.2f\n\n",delta_area(side1,side2,side3));
system("pause");
}
double delta_area(double x, double y, double z)//定义三角形面积函数
{
double s,p;
p=(x+y+z)\2;
s= sqrt (p*(p-x)*(p-y)*(p-z));
return(s);
}
p=(x+y+z)/2
除不能写成 \ 谢谢,是我粗心了!!
页:
[1]