只是用来保存~~~
#include <stdio.h>
void main()
{ int score;/*score:成绩*/
printf("请输入成绩:");
scanf("%d",&score);
if (score>100||score<0)
printf("输入错误");
else if (score>=90 &&score<=100)
printf("优秀\n");
else if (score>=70)
printf("良好\n");
else if (score>=60)
printf("及格\n");
else printf("不及格\n");
}
#include <stdio.h>
void main()
{ int score,scale;/*score:成绩*/
printf("请输入成绩:");
scanf("%d",&score);
if (score==100)
scale=9;
else scale=score/10;
switch (scale)
{ case 0:
case 1:
case 2:
case 3:
case 4:
case 5: printf("不及格\n");
break;
case 6:printf("及格\n");
break;
case 7:
case 8:printf("良好\n");
break;
case 9:printf("优秀\n");
break;
default:printf("输入错误\n");
}
}