- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- re:
- char x;
- cout<<"小米的腦殘問答"<<endl;
- cout<<"請問豬有幾隻腳(1)1隻(2)2隻(3)3隻(4)4隻"<<endl;
- cout<<"請作答"<<endl;
- cin>>x;
- switch(x)
- {
- 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;
- }
複製代碼 |