- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main(){
- char ans;
- cout<<"<小熙的87問題> ";
- cout<<"請問貓有幾隻腳? (A)一隻 (B)兩隻 (C)三隻 (D)四隻"<<endl;
- cout<<"請作答";
- cin>>ans;
-
- switch(ans)
- {
-
- case 'A':
- case 'a':
- cout<<"唉 可憐哪";
- break;
- case 'B':
- case 'b':
- cout<<"醫院往前右轉";
- break;
- case 'C':
- case 'c':
- cout<<"下面一位~";
- break;
- case 'D':
- case 'd':
- cout<<"IQ180";
- break;
- default:
- cout<<"輸入錯誤";
- break;
- }
- system("pause");
- return 0;
- }
複製代碼 |