返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int score;
  7.    
  8.     cout<<"請輸入你要的飲料(1.mxmx綠茶 2.奈米紅茶 3.看不見的冰沙)";
  9.     cin>>score;
  10.    
  11.     switch (score){
  12.     case 1:      
  13.        cout<<"mxmx綠茶"<<endl;
  14.        break;
  15.    
  16.    
  17.     case 2:      
  18.     cout<<"奈米紅茶"<<endl;
  19.     break;

  20.    
  21.     case 3:      
  22.     cout<<"看不見的冰沙"<<endl;
  23.     break;
  24.    
  25.     default:
  26.        cout<<"輸入錯誤"<<endl;
  27.        }     
  28.     system("pause");
  29.     return 0;   
  30. }
複製代碼

TOP

返回列表