本帖最後由 鄭繼威 於 2022-6-13 19:38 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int score;
- cout<<"你月考考幾分?:"<<endl;
- cin>>score;
- switch(score
- {
- case 90 ...100:
- cout<<"優等"<<endl;
- break;
- case 89 ...80:
- cout<<"甲等"<<endl;
- break;
- case 79 ...70:
- cout<<"乙等"<<endl;
- break;
- case 69 ...60:
- cout<<"丙等"<<endl;
- break;
- case 59 ...0:
- cout<<"丁等"<<endl;
- break;
- default
- cout<<"你再亂講,我就打死你"<<endl;
- }
- system("pause")
- return 0;
- }
複製代碼 因為太簡單了所以先偷吃步了 |