C how to program; 习题3.45: 输入三个非零整数,判断是否能构成三角形。
1 #include<stdio.h> 2 int main(void) 3 { 4 float x,y,z; 5 printf("Please input the x,y,z: "); 6 scanf("%f%f%f",&x,&y,&z); 7 if ((x+y)>z && (x+z)>y && (y+z)>x ) 8 printf("YES"); 9 else 10 printf("NO!"); 11 return 0; 12 }