- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int x;
- cout<<"請輸入成績:"<<endl;
- cin>> x;
- switch(x)
- {
- case 80...100:
- cout<<"甲等"<<endl;
- break;
- case 70...79:
- cout<<"乙等"<<endl;
- break;
- case 60...69:
- cout<<"丙等"<<endl;
- break;
- case 0...59:
- cout<<"甲等"<<endl;
- break;
- default:
- cout<<"不誠實"<<endl;
- }
- system("pause");
- return 0;
- }
複製代碼 |