返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int ans;
  7.     cout<<"蘋果的英文是:(1)apple,(2)book,(3)banana"<<endl;
  8.     cin>>ans;
  9.     switch (ans)
  10.     {
  11.            case 1:
  12.                 cout<<"答對啦!"<<endl;
  13.                 break;
  14.            case 2:
  15.                 cout<<"答錯了...正確是(1)喔"<<endl;
  16.                 break;
  17.            case 3:
  18.                 cout<<"答錯了...正確是(1)喔"<<endl;
  19.                 break;   
  20.            default:
  21.                    cout<<"沒有這個答案喔"<<endl;            
  22.     }
  23.                         
  24.     system("pause");   
  25.    return 0;
  26. }
複製代碼

TOP

返回列表