#40065: c++ans


yp11251120@yphs.tp.edu.tw (708-43劉濟緯)

學校 : 臺北市私立延平高級中學
編號 : 237257
來源 : [203.72.178.1]
最後登入時間 :
2024-04-18 17:28:22
c636. 十二生肖 -- it's david | From: [203.72.178.1] | 發表日期 : 2024-04-26 11:30

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string c[12]={"豬","鼠","牛","虎","兔","龍","蛇","馬","羊","猴","雞","狗"};
    string d[12]={"鼠","豬","狗","雞","猴","羊","馬","蛇","龍","兔","虎","牛"};
    int a,b;
    while(cin>>a)
    {
    if(a>0)
    {
    b=a%12;
    cout<<c[b]<<endl;
    }
    if(a<0)
    {
      b=abs(a)%12;
      cout<<d[b]<<endl;
    }   
    }
}

 
ZeroJudge Forum