求一道C语言编程题,如图

2024-12-26 18:30:55
推荐回答(1个)
回答1:

void main()
{
int i,k;
char ch;
printf("请输入成绩:\n");
scanf("%d",&i);
k = i/10;
switch(k)
{
case 10:
case 9: ch = 'A';break;
case 8: ch = 'B';break;
case 7: ch = 'C';break;
case 6: ch = 'D';break;
default: ch = 'E';break;

}
printf("成绩等级%c",ch);
}