- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main(){
- int option;
- cout<<"請問豬有幾隻腳:(1)沒有腳(2)一隻(3)兩隻(4)三隻(5)四隻(6)五隻 "<<endl;
- cin>>option;
- switch (option) {
- case 1:
- cout<<"請問豬腳是哪裡來的呢?"<<endl;
- break;
- case 2:
- cout<<"一隻?站都暫不穩!"<<endl;
- break;
- case 3:
- cout<<"是豬,不是雞喔~"<<endl;
- break;
-
- case 4:
- cout<<"??????三隻??"<<endl;
- break;
- case 5:
- cout<<"太聰明了!真是厲害"<<endl;
- break;
- case 6:
- cout<<"這麼多腳嗎?"<<endl;
- break;
- default:
- cout<<"輸入錯誤,請讀選項"<<endl;
-
- }
- system("pause");
- return 0;
- }
複製代碼 |