0-59,60-69,70-79,80-89,90-100分别为等级E,D,C,B,A。运用if,else语句划分等级。
#include <stdio.h>
int main()
{
int score,b;
scanf(“%d”,&score);
if(score>=90)
printf(“A\n”);
else if(score>=80&&score<90)
printf(“B\n”);
else if(score>=70&&score<80)
printf(“C\n”);
else if(score>=60&&score<70)
printf(“D\n”);
else
printf(“E\n”);
return 0;
}