- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int ans;
- cout<<"<小米腦殘問答>"<<endl;
- cout<<"請問一隻豬有幾隻腳? <A>一隻 <B>兩隻 <C>三隻 <D>四隻"<<endl;
- cout<<"請作答:";
- cin>>ans;
- cout<<ans<<endl;
- switch (ans)
- {
- 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<<"請勿亂輸入"<<endl;
- break;
- }
- system("pause");
- return 0;
- }
複製代碼 |