满意答案
#include
int main(int argc,char *argv[]){
int a,b,c;
printf("Input a, b, c(int a, b, c>0)...\n");
if(scanf("%d%d%d",&a,&b,&c)!=3 || a<1 || b<1 || c<1){
printf("Input error, exit...\n");
return 0;
}
if(a+b>c && b+c>a && c+a>b){
if(a==b || b==c || c==a)
printf("An isosceles triangle.\n");
else if(a*a+b*b==c*c || a*a+c*c==b*b || c*c+b*b==a*a)
printf("A right triangle.\n");
else
printf("A general triangle.\n");
}
else
printf("Don't make a triangle...\n");
return 0;
}
02分享举报