本帖最後由 劉得恩 於 2014-1-23 11:05 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
-
- int main()
- {
- int score,level;
- cout<<"請輸入您的分數:";
- cin>>score;
- level=score/10;
- cout<<"您的評等是:";
- switch(level)
- {
- case 10:
- case 9:
- cout<<"A"<<endl;
- break;
- case 8:
- cout<<"B\n";
- break;
- case 7:
- cout<<"C\n";
- break;
- case 6:
- cout<<"D\n";
- break;
- default:
- cout<<"E\n";
- break;
- }
- system("PAUSE");
- return 0;
- }
複製代碼 |