返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main(){
  5.     int anwser;
  6.     cout<<"<小米的腦殘問答>請問豬有幾隻腳?(1)1隻(2)2隻(3)3隻(4)4隻"<<endl;
  7.     cout<<"請作答"<<endl;
  8.     cin>>anwser;
  9.     switch(anwser){
  10.         case 'a':
  11.         case 'A':
  12.              cout<<"怎麼可能? 一隻腳怎麼走!"<<endl;
  13.              break;
  14.         case 'b':
  15.         case 'B':
  16.              cout<<"沒吃過豬肉也看過豬走路!"<<endl;
  17.              break;
  18.         case 'c':
  19.         case 'C':
  20.              cout<<"此跑山豬非跑三豬也!"<<endl;
  21.              break;
  22.         case 'd':
  23.         case 'D':
  24.              cout<<"答對了"<<endl;
  25.         default:
  26.              cout<<"輸入錯誤"<<endl;
  27.         }
  28.     system("pause");
  29.     return 0;
  30. }
複製代碼

TOP

返回列表