- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- char answer;
- cout <<"<???>"<<endl;
- cout <<"你晚上吃什麼? (a)垃圾 (b)鋼鐵 (c)我 (d)沒有吃東西"<<endl;
- cout <<"請作答:";
- cin >> answer;
- switch(answer)
- {
- case 'a':
- case 'A':
- cout <<"你是流浪漢嗎?"<<endl;
- break ;
- case 'b':
- case 'B':
- cout <<"嗨!鋼鐵人"<<endl;
- break ;
- case 'c':
- case 'C':
- cout <<"回家吃自己!"<<endl;
- break ;
- case 'd':
- case 'D':
- cout <<"你失憶了,走!去看醫生."<<endl;
- break ;
- default:
- cout <<"不會數數嗎,只有4而已!!"<<endl;
-
- }
- system("pause");
- return 0;
- }
複製代碼 |