返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main(){
  5.         int age;
  6.         cout<<"請輸入年紀: ";
  7.         cin>>age;
  8.         if(age>=0&&age<=5)
  9.           cout<<"兒童免票"<<endl;
  10.         else if(age>5&&age<=11)
  11.           cout<<"兒童票:590 元"<<endl;
  12.         else if(age>11&&age<=17)
  13.           cout<<"青少年票:790 元"<<endl;
  14.         else if(age>17&&age<=59)
  15.           cout<<"成人票:890 元"<<endl;
  16.         else if(age>59&&age<=120)
  17.           cout<<"敬老票:399 元"<<endl;
  18.         else
  19.           cout<<"你不是人"<<endl;
  20.         system("pause");
  21.         return 0;
  22. }
複製代碼
ABCDEFGHIJKLMNOPQRSTUVWXYZ

TOP

返回列表