- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int age;
- cout<<"請輸入你的年齡:";
- cin>>age;
-
- if(age<=3 && age>=1)
- {
- cout<<"幼兒票,免費入場"<<endl;
-
- }else if(age>=4 && age<=12)
- {
- cout<<"兒童票,50元"<<endl;
- }else if(age>=13 && age<=64)
- {
- cout<<"一般票,100元"<<endl;
- }else if(age>=65 && age<=100)
- {
- cout<<"老人票,免費"<<endl;
- }else
- {
- cout<<"輸入錯誤,或是太老了禁止入園"<<endl;
- }
-
-
-
- system("pause");
- return 0;
- }
複製代碼 |