- #include <iostream>
- using namespace std;
- int main()
- {
- int score, level;
- cout<<"please key in your score:";
- cin>>score;
- level = score/10;
- switch(level)
- {
- case 10:
- case 9:
- case 8:
- cout<<"super";
- break;
- case 7:
- cout<<"Oh!dear!!";
- break;
- case 6:
- cout<<"that's terrible";
- break;
- case 5:
- case 4:
- case 3:
- case 2:
- case 1:
- case 0:
- cout<<"not great";
- break;
- default:
- cout<<"you key in the wrong thing!";
- }
- cout<<endl;
- system("pause");
- return 0;
- }
複製代碼 |