- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- re:
- char x;
- cout<<"豬有幾隻腳 a.1 b.2 c.3 d.4 ";
- 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<<"yes"<<endl;
- break;
- default:
- cout<<"error"<<endl;
- break;
- }
- cout<<""<<endl;
- goto re;
- system("pause");
- return 0;
- }
複製代碼 |