- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main ()
- {
- int answer;
- cout<<" 一, 選擇題"<<endl;
- cout<<"請問豬的運動型態為何? (1)飛(2)爬(3)走(4)以上全部正確"<<endl;
- cin >>answer;
- switch(answer)
- {
- case 1:
- cout<<"你有看過豬長翅膀的嗎?"<<endl;
- break;
- case 2:
- cout<<"豬不是昆蟲!"<<endl;
- break;
- case 3:
- cout<<"賓果!!"<<endl;
- break;
- case 4:
-
- cout<<"瞎!"<<endl;
- break;
- default:
- cout<<"輸入錯誤"<<endl;
-
- }
- system ("pause");
- return 0;
- }
複製代碼 |