- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main ()
- {
- int score,level;
- cout << "請輸入您的成績:";
- cin >> score;
- level = score/10;
- switch (level)
- {
- case 10:
- case 9:
- case 8:
- cout << " 恭喜你! ";
- break;
- case 7:
- cout << " 多複習點吧!" ;
- break;
- case 6:
- cout << " 你上課有在專心聽嗎? ";
- break;
- case 5:
- case 4:
- case 3:
- case 2:
- case 1:
- case 0:
- cout << " 回家等著被罵吧! ";
- break;
- default:
- cout << " 輸入錯誤! ";
- }
- cout << endl;
- system("pause");
- return 0;
- }
複製代碼 |