返回列表 發帖
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int bird;
  6.     cout<<"***有趣問答題***"<<endl;
  7.     cout<<"猜猜看小鳥大便裡有什麼?"<<endl;
  8.     cout<<"(1) 肉渣 (2) 什麼都沒有 (3) 果實 (4) 都不是"<<endl;
  9.     start:
  10.     cout<<"請做答: ";
  11.     cin>>bird;
  12.     if(bird==1)
  13.     {
  14.         cout<<"笨!小鳥怎麼可能吃肉!"<<endl;
  15.         goto start;
  16.     }
  17.     else if(bird==2)
  18.     {
  19.         cout<<"小鳥不吃食物怎麼活下去,你要他們餓死啊!"<<endl;
  20.         goto start;
  21.     }
  22.     else if(bird==3)
  23.     {
  24.         cout<<"你好厲害,答對了喔!!"<<endl;
  25.     }
  26.     else if(bird==4)
  27.     {
  28.         cout<<"都不是,那他們吃什麼!"<<endl;
  29.         goto start;
  30.     }
  31.     else
  32.     {
  33.         cout<<"輸 入 錯 勿!請 重 新 輸 入!"<<endl;
  34.         goto start;
  35.     }  
  36.     system("pause");
  37.     return 0;
  38. }
複製代碼

TOP

返回列表