#41935: djdjdjjdjd


dinson1007@gmail.com (Among us peter Huang)

學校 : 不指定學校
編號 : 272081
來源 : [223.138.126.38]
最後登入時間 :
2024-05-29 17:20:58
c636. 十二生肖 -- it's david | From: [223.139.87.114] | 發表日期 : 2024-09-11 20:01

#include<iostream>
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;
    }   
    }
}
Close
CPP
 
ZeroJudge Forum