1、编写如下:
//100分制
#include
void main()
{
int score,t;
printf("输入成绩:");
scanf("%d",&score);
t=score/10;//t的取值0,1,2,3,4,5,6,7,8,9,10
switch(t)
{
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:
case 10:printf("优秀\n");break;
}
}