- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int x;
- cout << "請輸入您的成績";
- cin >> x;
- x= x/10;
- switch (x)
- {
- case 10:case 9:
- cout << "優";
- break;
- 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 << "很皮喔!";
- break;
- }
- return 0;
- }
複製代碼 |