本帖最後由 陳泓亦 於 2022-9-3 15:04 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int ans;
- cout<<"<小米的腦殘問答>"<<endl;
- cout<<"請問豬有幾隻腳? (1)一隻(2)兩隻(3)三隻(4)四隻 "<<endl;
-
- cout<<"請作答: ";
- cin>>ans;
- switch(ans)
- {
- case 1:
- cout<<"單腳豬?";
- break;
-
- case 2:
- cout<<"豬會走路?";
- break;
-
- case 3:
- cout<<"變異豬?";
- break;
- case 4:
- cout<<"答對囉!";
- break;
- default:
- cout<<"輸入錯誤!";
- }
- cout<<endl;
- system("pause");
- return 0;
-
-
- cout<<endl;
- system("pause");
- return 0;
-
- }
複製代碼 |