大佬们怎么做呀
用switch语句实现成绩大于等于85为A
成绩大于等于75为B
成绩大于等于60为C
成绩小于60为D
#include <stdio.h> void main() { int score; char level = 'D'; printf("请输入成绩(0~100):"); scanf("%d", &score); if (score < 0 || score > 100) { printf("成绩输入错误\n"); return; } score = score/5; switch (score) { case 20: case 19: case 18: case 17: level--; case 16: case 15: level--; case 14: case 13: case 12: level--; } printf("等级:%c\n", level); }