用switch语句编写及格线
时间: 2023-04-04 17:00:59 浏览: 96
switch语句
switch (score / 10) {
case 10:
case 9:
printf("成绩等级为:优秀\n");
break;
case 8:
printf("成绩等级为:良好\n");
break;
case 7:
printf("成绩等级为:中等\n");
break;
case 6:
printf("成绩等级为:及格\n");
break;
default:
printf("成绩等级为:不及格\n");
break;
}
阅读全文