返回列表 發帖
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.       int age;               
  6.       cout<<"請輸入你的年齡";
  7.       cin>>age;
  8.       cout<<""<<age<<"歲"<<endl;
  9.       if(age<=3)
  10.       {
  11.           cout<<"請購買幼兒票"<<endl;
  12.       }else if(age>=4 && age<=12)     
  13.       {
  14.           cout<<"請購買兒童票"<<endl;
  15.       }else if(age>=13 && age<=64)
  16.       {
  17.           cout<<"請購買一般票"<<endl;
  18.       }else if(age>=65)
  19.       {
  20.           cout<<"請購買敬老票"<<endl;
  21.       }
  22.       system("pause");
  23.       return 0;   

  24. }
複製代碼

TOP

返回列表