返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int age;
  7.    
  8.     cout<<"請輸入您的年齡: ";
  9.     cin>>age;
  10.    
  11.     if(age<12)
  12.     {
  13.          cout<<"您正處於歡樂童年"<<endl;
  14.     }
  15.     else if(age<30)
  16.     {
  17.          cout<<"您正處於花樣年華"<<endl;
  18.     }
  19.     else if(age<50)
  20.     {
  21.          cout<<"您正處於壯年時期"<<endl;
  22.     }
  23.     else if(age<65)
  24.     {
  25.          cout<<"您正處於更年期"<<endl;
  26.     }
  27.     else if(age<100)
  28.     {
  29.          cout<<"您是樂活銀髮"<<endl;
  30.     }
  31.     else if(age>100)
  32.     {
  33.          cout<<"您是一位人瑞啊!!!"<<endl;
  34.     }
  35.      system("pause");
  36.     return 0;
  37. }

  38.                
  39.    
  40.    
複製代碼

TOP

返回列表