返回列表 發帖
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. using namespace std;
  5. int main()
  6. {
  7.     int x;
  8.     re:
  9.     cout<<"請輸入出生之西元年: ";
  10.     cin>>x;
  11.     x=x-1911;
  12.     x=x%12;
  13.     string a[]{"鼠","牛","虎","兔","龍","蛇","馬","羊","猴","雞","狗","豬"};
  14.     cout<<endl<<a[x-1]<<"年!"<<endl<<endl;
  15.     goto re;
  16. }
複製代碼

TOP

返回列表