成绩转换问题
1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<math.h> 4 #include<string.h> 5 int main() 6 { 7 int score; 8 while (scanf("%d",&score)!=EOF) 9 { 10 if (score>=0) 11 switch(score/10) 12 { 13 case 0: printf("E "); break; 14 case 1: printf("E "); break; 15 case 2: printf("E "); break; 16 case 3: printf("E "); break; 17 case 4: printf("E "); break; 18 case 5: printf("E "); break; 19 case 6: printf("D "); break; 20 case 7: printf("C "); break; 21 case 8: printf("B "); break; 22 case 9: printf("A "); break; 23 default: if (100==score) 24 printf("A "); 25 else 26 printf("Score is error! "); break; 27 } 28 else printf("Score is error! "); 29 } 30 return 0; 31 }