题目地址:https://www.patest.cn/contests/gplt/L1-031
思路:简单
注意点:又大意了,输出字符的大小写没对,查找半天》》》》》》》》》》》》》》》》》》》》》》》
1 #include<stdio.h> 2 #include<math.h> 3 int main() 4 { 5 int n,i,h[21][2]; 6 scanf("%d",&n); 7 for(i=0;i<n;i++){ 8 scanf("%d %d",&h[i][0],&h[i][1]); 9 } 10 // for(i=0;i<n;i++){ 11 // printf("%d %d",h[i][0],h[i][1]); 12 // } 13 for(i=0;i<n;i++) 14 { 15 double a,c; 16 a=(h[i][0]-100)*0.9; 17 c=a-(double)h[i][1]/2.0; 18 if(fabs(c)<a*0.1){ 19 printf("You are wan mei!\n");} 20 else if(a<(double)h[i][1]/2.0){ 21 printf("You are tai pang le!\n");} 22 else{ 23 printf("You are tai shou le!\n");} 24 } 25 return 0; 26 }