- [code]#include<iostream>
- #include<cstdlib>
- using namespace std;
- int main(){
- int choice;
- cout<<"請輸入您要點的飲料(1.水,2.白開水,3.礦泉水):";
- cin>>choice;
- switch(choice){
- case 1:
- cout<<"你點了水"<<endl;
- break;
- case 2:
- cout<<"你點了白開水"<<endl;
- break;
- case 3:
- cout<<"你點了礦泉水"<<endl;
- break;
- default:
- cout<<"輸入錯誤"<<endl;
- }
- system ("pause");
- return 0;
- }
複製代碼 [/code] |