- #include<cstdlib>
- #include<iostream>
- using namespace std;
- int main()
- {
- char a;
- cout<<"請問皮卡丘的顏色是? (A)黃色 (B)螢光黃 (C)彩色 (D)透明"<<endl;
- cout<<"請作答: ";
- cin>>a;
- switch(a)
- { 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;
- break;
- }
- cout<<endl;
- system("pause");
- return 0;
- }
複製代碼 |