返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.            
  7.             int age;
  8.             cout<<"遊樂園驗票系統 "<<endl;
  9.             cout<<"請輸入你的年齡: ";
  10.             cin>>age;
  11.             if(age<=3 && age>=1)
  12.             {
  13.             cout<<"幼兒票 免費入場!!讚!"<<endl;
  14.             }
  15.             else if(age>=4 && age<=12)
  16.             {
  17.             cout<<"兒童票 50元"<<endl;
  18.             }
  19.             else if(age>=13 && age<=64)
  20.             {
  21.             cout<<"一般票 100元"<<endl;
  22.             }
  23.             else if(age>=65 && age<=114)
  24.             {
  25.             cout<<"敬老票 70元"<<endl;
  26.             }
  27.             else
  28.             {
  29.             cout<<"輸入錯誤"<<endl;
  30.             }
  31.         
  32.         system("pause");
  33.         return 0;

  34. }
複製代碼

TOP

返回列表