- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int x;
- cout << "請輸入您的成績";
- cin >> x;
- x= x/10;
- switch (x)
- {
- case 10:
- cout << "優";
- break;
- case 9:
- cout << "優";
- break;
- case 8:
- cout << "甲";
- break;
- case 7:
- cout << "乙";
- break;
- case 6:
- cout << "丙";
- break;
- case 5:
- cout << "丁";
- break;
- case 4:
- cout << "丁";
- break;
- case 3:
- cout << "丁";
- break;
- case 2:
- cout << "丁";
- break;
- case 1:
- cout << "丁";
- break;
- case 0:
- cout << "丁";
- break;
- default:
- cout << "很皮喔!";
- break;
- }
- return 0;
- }
複製代碼 |