- #include<iostream>
- using namespace std;
- int main()
- {
- re:
- char o;
- cout<<"<小明的腦殘答> "<<endl;
- cout<<"請問豬有幾隻腳?<A>一隻<B>二隻<C>三隻<D>四隻"<<endl;
- cout<<"請回答: ";
- cin>>o;
- switch(o)
- {
- case 'a':
- case 'A':
- cout<<"用跳的嗎?"<<endl;
- break;
- case 'b':
- case 'B':
- cout<<" 沒吃過豬肉也看過豬走路!"<<endl;
- break;
- case 'c':
- case 'C':
- cout<<"你是豬啊?"<<endl;
- break;
- case 'd':
- case 'D':
- cout<<"答對了!"<<endl;
- break;
- default:
- cout<<" 輸入錯誤!"<<endl;
- }
- goto re;
- system("pause");
- return 0;
- }
複製代碼 |