- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int answer;
- cout<<"請問你有幾個腦: (1)1顆,(2)2顆,(3)3顆,(4)4顆";
- cin>>answer;
- switch(ansewr)
- {
- case 1 :
- cout<<"沒常識!"<<endl;
- break;
- case 2:
- cout<<"答對了!"<<endl;
- break;
- case 3:
- cout<<"天生的蠢才!"<<endl;
- break;
- case 4:
- cout<<"有怪獸!"<<endl;
- break;
- default:
- cout<<"輸入錯誤"<<endl;
- }
- system("pause");
- return 0;
- }
複製代碼 |