判断三角形
#include<stdio.h>#include<math.h>
int main()
{
int x1,y1,x2,y2,x3,y3,a,b,c;;
while(scanf("%d %d %d %d %d %d",&x1,&y1,&x2,&y2,&x3,&y3)!=EOF)
{
a=sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
b=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
c=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
if(a+b>c||a+c>b||b+c>a)
{
printf("good\n");
}
else
{
printf("sorry\n");
}
}
return 0;
}
判断是否为三角形,输出的总是good,是哪错