第一个代码:
#include<stdio.h>
int main(int argc,const char * argv[]){
int score;
printf("请输入一个分数:\n");
scanf("%d",&score);
if(score<0||score>100){
printf("你考这个成绩,你妈妈知道么?");
return 0;
}
int s=score/10;
switch(s){
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;
}
}
第二个代码
#include<stdio.h>
int main(int argc,const char * argv[]){
int score;
printf("请输入一个分数:\n");
scanf("%d",&score);
int s=score/10;
switch(s){
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;
default:printf("你考这个成绩,你妈妈知道么?\n");
}
}
请问第一个代码和第二个这个代码有什么区别么?{:2_33:} |
|