返回列表 發帖
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int options;
  6.     cout<<"select your desired baverage(1.Coffee 2.Milk 3.Tea): ";
  7.     cin>>options;
  8.    
  9.     switch(options){
  10.     case 1:
  11.          cout<<"Coffee"<<endl;
  12.          break;
  13.     case 2:
  14.          cout<<"Milk"<<endl;
  15.          break;
  16.     case 3:
  17.          cout<<"Tea"<<endl;
  18.          break;
  19.     default:
  20.             cout<<"oops, information out of reach...";
  21. }
  22. system ("pause");

  23. return 0;
  24. }
複製代碼

TOP

返回列表