switch实现成绩打等级

 1 #include 
 2 
 3 int main()
 4 {
 5     int grade;
 6     scanf_s("%d", &grade);
 7     grade = grade / 10;
 8     switch (grade)
 9     {
10         case 10:
11         case 9:printf("A\n"); break;
12         case 8:printf("B\n"); break;
13         case 7:printf("C\n"); break;
14         case 6:printf("D\n"); break;
15         default:printf("F\n");break;
16     }
17     
18     return 0;
19 }

 

转载于:https://www.cnblogs.com/2018jason/p/10942626.html

你可能感兴趣的:(switch实现成绩打等级)