本帖最後由 t3742238 於 2011-10-1 17:00 編輯
- #include <iostream>
- using namespace std;
- int main()
- {
- int score, level;
- cout<<"請輸入你的成績: ";
- cin>>score;
- level = score/10;
- switch(level)
- {
- case 10:
- case 9:
- 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<<"輸入錯誤! 呆~~~子~";
- }
- cout<<endl;
- system("pause");
- return 0;
- }
複製代碼 |