- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
-
- int score;
- int level;
-
- cout << "請輸入您的分數:";
- cin >> score;
- level = score / 10;
-
- switch(level)
- {
- case 10:
- case 9:
- cout << "A" << endl;
- break;
-
- case 8:
- cout << "B" << endl;
- break;
-
- case 7:
- cout << "C" << endl;
- break;
-
- case 6:
- cout << "D" << endl;
- break;
- default:
- cout << "E" << endl;
- break;
- }
-
-
- system("pause");
- return 0;
- }
複製代碼 |