返回列表 發帖
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.    int age;
  6.    cout<<"請輸入你的成績";
  7.    cin>>age;
  8.    cout<<""<<age"歲"endl;
  9.    {
  10.    if(age<=3)
  11.    {
  12.       cout<<"請購買幼兒票"<<endl;         
  13.    }else if(age>=4 && age<=12)
  14.    {
  15.      cout<<"請購買兒童票"<<endl;
  16.    }else if(age>=13 && age<=64)
  17.    {
  18.    cout<<"請購買一般票"<<endl;
  19.    }else if(age>=64)      
  20.    
  21.     cout<<"請敬老票"<<endl;
  22.     }
  23.     system("pause");
  24.     return 0;
  25.    
  26.    
  27.    
  28.    
  29.    
  30.    
  31.    
  32.    
  33.    
  34.    
  35.      
複製代碼

TOP

返回列表