- #include<iostream>
- using namespace std;
- int main()
- {
- int score;
- int level;
- cout<<"請輸入您的分數: ";
- cin>>score;
- level=score/10;
- switch(level)
- {
- case 10:
- case 9:
- cout<<"得 A !"<<endl;
- break;
- case 8:
- cout<<"得 B !"<<endl;
- break;
- case 7:
- cout<<"得 C !"<<endl;
- break;
- case 6:
- cout<<"得 D !"<<endl;
- break;
- default:
- cout<<"得 E !不 及 格!"<<endl;
- break;
- }
- system("pause");
- return 0;
- }
複製代碼 |