- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int option;
- cout<<"豬有幾隻腳?(1.一隻2.兩隻3.三隻4.四隻):"<<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;
- default
- cout<<"輸入錯誤"<<endl;
- }
- system("pause")
- return 0;
- }
複製代碼 |