本帖最後由 張恩嘉 於 2016-5-24 10:04 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int score;
- re:
- cout<<"請輸入你的成績";
- cin>>"score:"
- switch(score);
- {
- 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;
-
-
- }
- goto re;
- system("pause");
- return 0;
- }
複製代碼 |