- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- char answer;
- cout<<"<超腦殘問答>"<<endl;
- cout<<"雞有幾顆頭?(a)1顆(b)2顆(c)3顆(d)無限多顆"<<endl;
- cout<<"請作答!!!";
- cin>>answer;
- switch(answer)
- {
- case 'a':
- case 'A':
- cout<<"答對了!!好厲害!";
- break;
- case 'b':
- case 'B':
- cout<<"智商-10000000000";
- break;
- case 'c':
- case 'C':
- cout<<"恐怖啊!";
- break;
- case 'd':
- case 'D':
- cout<<"慘了!雞變成了怪物";
- break;
- default:
- cout<<"輸入錯誤!";
-
- }
- cout<<endl;
-
- system("pause");
- return 0;
- }
複製代碼 |