返回列表 發帖
  1. #include <iostream>
  2. using namespace std;
  3. int main()

  4. {
  5.     int answer;
  6.     cout<<"猜猜someone今年心智年齡幾歲?"<<endl;
  7.     cout<<"(1) 1歲 (2) 13歲 (3) 20歲 (4) 40歲"<<endl;
  8.     cin>>answer;
  9.     cout<<endl;
  10.     switch (answer)
  11.    {
  12.     case 1:
  13.     cout<<"有那麼年輕嗎!";
  14.     break;
  15.     case 2:
  16.     cout<<"賓果!你答對了!";
  17.     break;
  18.     case 3:
  19.     cout<<"沒有那麼老啦!";
  20.     break;
  21.     case 4:
  22.     cout<<"你是來亂的喔!";
  23.     default:
  24.     cout<<"輸入錯誤";
  25.    }
  26.     system("pause");
  27.     return 0 ;
  28. }

  29.      
複製代碼

TOP

返回列表