返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     re:
  7.     int option;
  8.     cout<<"<小米的腦殘問題>"<<endl;
  9.     cout<<"請問豬有幾隻腳? (1)一隻(2)二隻(3)三隻(4)四隻"<<endl;
  10.     cout<<"請作答:";
  11.     cin>>option;
  12.     switch(option)
  13.     {
  14.     case 1:
  15.         cout<<"用跳的嗎?"<<endl;
  16.         break;
  17.     case 2:
  18.         cout<<"沒吃過豬肉也看過豬走路!"<<endl;
  19.         break;
  20.     case 3:
  21.         cout<<"你是豬啊?"<<endl;
  22.         break;
  23.     case 4:
  24.         cout<<"答對了!"<<endl;
  25.         break;
  26.     default:
  27.         cout<<"輸入錯誤!"<<endl;
  28.         }
  29.         cout<<endl;
  30.         goto re;
  31.         system("pause");
  32.         return 0;
  33. }
複製代碼

TOP

返回列表