Score Conversion
Time Limit: 2000/1000 MS (Java/others) memory limit: 65536/32768 K (Java/Others)
Total submission (s): 75179 accepted submission (s): 33050
Problem description: enter a percentage t to convert the score to the corresponding level. The specific conversion rules are as follows:
90 ~ 100 is;
80 ~ 89 is B;
70 ~ 79 is C;
60 ~ 69 is D;
0 ~ 59 is E; input data contains multiple groups, each of which occupies one row and is composed of an integer. Output outputs a row of input data for each group. If the input data is not 0 ~ Within the range of 100, please output a line: "score is error !". Sample input5667100123 sample outputedascore is error!
1 #include<cstdio> 2 int main() 3 { 4 int m; 5 while(scanf("%d",&m)==1) 6 { 7 if(m<0||m>100){printf("Score is error!\n");continue;} 8 switch(m/10) 9 {10 case 10:case 9:printf("A\n");break;11 case 8:printf("B\n");break;12 case 7:printf("C\n");break;13 case 6:printf("D\n");break;14 default:printf("E\n");break;15 }16 }17 return 0;18 }
Hangzhou (Hangzhou), 2004 20:04:30