- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int answer;
- cout<<"蘋果的英文是什麼:(1)apple(2)book(3)stupid"<<endl;
- cout<<"你的答案是什麼:"<<endl;
- cin>>answer;
- switch (answer)
- {
- case 1:
- cout<<"你答對了"<<endl;
- break;
- case 2:
- cout<<"你答錯了,book是書"<<endl;
- break;
- case 3:
- cout<<"你答錯了,stupid是愚笨";
- break;
- default:
- cout<<"沒有這個選項";
- }
-
- system("pause");
- return 0;
- }
複製代碼 |