返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int ans;
  7.     string msg;
  8.     cout<<"請輸入豬有幾隻腳:";
  9.     cin>>ans;
  10.     switch(ans)
  11.     {
  12.          case 4:      
  13.               msg="答對了!!!";
  14.               break;
  15.          default:      
  16.               msg="白癡!!!";            
  17.     }
  18.     cout<<msg<<endl;
  19.     system("pause");
  20.     return 0;
  21. }
複製代碼

TOP

返回列表