#25715: TLE ~


alex950301 (alex0301)

學校 : 新北市立新莊高級中學
編號 : 141423
來源 : [210.71.71.209]
最後登入時間 :
2024-04-25 17:19:37
c636. 十二生肖 -- it's david | From: [61.64.1.159] | 發表日期 : 2021-06-16 11:20

#include <iostream>

#include <math.h>

using namespace std;  

int main () { 

int x,y; 

    string a[] = {"鼠","牛","虎","兔","龍","蛇","馬","羊","猴","雞","狗","豬"};

    while( cin >> x ) {

    y = 0;

    if( x < 0 ) y = 13;

    x = x % 12 - 1 + y;

    cout << a[x] << endl;

}

 

 
ZeroJudge Forum