#include <stdio.h> int main(void) { int a; printf("请输入一个数字:"); scanf("%d", &a); printf("对应等级为:"); switch (a/10 ) { case 10: case 9 : printf("A\n");break; case 8 : printf("B\n");break; case 7 : case 6: printf("C\n");break; default: printf("D\n");break; } }