判别三角形
#include<stdio.h>#include<stdlib.h>
#include<ctype.h>
#include<math.h>
int main()
{
float a, b, c,p,q,s;
scanf_s("%d%d%d", &a, &b, &c);
if (a+b>c&&a+c>b&&b+c>a)
{
p = a + b + c;
q = (a + b + c) / 2.0;
s = sqrt(q*(q - a)*(q - b)*(q - c));
printf("c=%d,s=%d",p,s);
if (a == b == c) printf("正三角形");
if (a == b || a == c || b == c) printf("等腰三角形");
if (a*a + b*b == c*c || a*a + c*c == b*b || b*b + c*c == a*a)printf("直角三角形");
else printf("一般三角形");
}
else printf("error!");
system("pause");
return 0;
}
哪里错了呢