勾股定理...
1 #include<cstdio> 2 #include<algorithm> 3 using namespace std; 4 5 int main() 6 { 7 //freopen("input.txt","r",stdin); 8 int s[3]; 9 int T; 10 int count; 11 count = 1; 12 scanf("%d",&T); 13 while(T--) 14 { 15 16 for(int i = 0; i < 3; i++) 17 scanf("%d",&s[i]); 18 sort(s,s+3); 19 printf("Scenario #%d: ",count); 20 if(s[0]*s[0] + s[1]*s[1] == s[2]*s[2]) 21 printf("yes "); 22 else printf("no "); 23 count++; 24 puts(""); 25 } 26 27 return 0; 28 }