1 #include <iostream>
2 using namespace std;
3 char grand(int);
4 int main()
5 {
6 int n;
7 while (cin>> n)
8 {
9 if (n>100 || n<0)
10 {
11 cout << "Score is error!" << endl;
12 continue;
13 }
14 cout<< grand(n)<< endl;
15 }
16 }
17
18 char grand(int n)
19 {
20 switch (n/10)
21 {
22 case 9:
23 case 10:
24 return ‘A‘;
25 break;
26 case 8:
27 return ‘B‘;
28 break;
29 case 7:
30 return ‘C‘;
31 break;
32 case 6:
33 return ‘D‘;
34 break;
35 default:
36 return ‘E‘;
37 break;
38 }
39 }
杭电 2004
时间: 2024-10-06 20:49:06