//成绩评比//
#include<stdio.h>
int main()
{
int grade;
printf("请输入百分制成绩:");
scanf("%d",&grade);
if(0<=grade&&grade<=100)
{
grade/=10; }
switch(grade)
{
case 10:
case 9:printf("A\n");break;/*case 10和case 9的评比*/
case 8:printf("B\n");break;
case 7:printf("C\n");break;
case 6:printf("D\n");break;
case 5:
case 4:
case 3:
case 2:
case 1:
case 0:printf("E\n");break;
default:printf("输入错误!"); break;
}
return 0;
}
C语言——成绩评比
最新推荐文章于 2024-08-17 10:20:49 发布