- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
-
- char x;
- cout<<"1+1=? (a)1 (b)2 (c)3 (d)4"<<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;
- }
-
- system("pause");
- return 0;
- }
複製代碼 |