/*A:90~100
B:80~89
C:70~79
D:60~69
E:0~60
*/
#include<stdio.h>
int main (){
int score=0;
while(1){
printf("请输入一个0到100之间的分数:\n");
scanf("%d",&score);
if(score<0||score>100){
printf("请输入一个正确的数字!!\n");
}
score/=10;
switch(score){
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:printf("E\n");break;
case 6:printf("D\n");break;
case 7:printf("C\n");break;
case 8:printf("B\n");break;
case 9:
case 10:printf("A\n");break;
}
}
return 0;
}
|
|