- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- char ans;
- cout<<"<小米的腦殘問答>"<<endl;
- cout<<"請問豬有幾隻腳? (A,a)一隻 (B,b)兩隻 (C,c)三隻 (D,d)四隻"<<endl;
- cout<<"請作答: ";
- cin>>ans;
- switch(ans)
- {
- case 'a':
- case 'A':
- cout<<"金雞獨立嗎!";
- break;
- case 'b':
- case 'B':
- cout<<"沒吃過豬肉也看過豬走路!";
- break;
- case 'c':
- case 'C':
- cout<<"會不穩啦!";
- break;
- case 'd':
- case 'D':
- cout<<"答對了";
- break;
- default:
- cout<<" 輸入錯誤";
- }
- system("pause");
- return 0;
- }
複製代碼 |