返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int age;
  7.     cout<<"請輸入妳的年齡:";
  8.     cin>>age;
  9.     if(age>=1 && age<=3)
  10.     {
  11.      cout<<"幼兒票!免費入場!再過幾年就要付錢了"<<endl;         
  12.     }
  13.     else if(age>=4 && age<12)
  14.     {
  15.      cout<<"兒童票!50元!錢拿來!"<<endl;   
  16.          }
  17.     else if(age>=13 && age<65)
  18.     {
  19.      cout<<"一般票!100元給我拿出來"<<endl;   
  20.          }
  21.     else if(age>=65 && age<110)
  22.      {
  23.      cout<<"敬老票!70元!老扣扣"<<endl;            
  24.      }
  25.     else
  26.     {
  27.      cout<<"沒這年齡!重輸入"<<endl;
  28.      }


  29. system("pause");
  30. return 0;
  31. }
複製代碼

TOP

返回列表