- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int A;
- cout<<"請問下面哪像是蘋果的英文 (1)apple (2)book (3)banana"<<endl;
- cout<<"請回答:";
- cin>>A;
- switch(A)
- {
- case 1:
- cout<<"恭喜答對"<<endl;
- break;
- case 2:
- cout<<"答錯了 book是書"<<endl;
- break;
- case 3:
- cout<<"答錯了 banana是香蕉"<<endl;
- break;
- default:
- cout<<"輸入錯誤"<<endl;
- }
- system("pause");
- return 0;
- }
複製代碼 |