[ACM]生肖与虚岁问题


ZOJ Problem Set - 3479
Chinese Zodiac

Time Limit:2 Seconds Memory Limit:65536 KB

TheShengxiao, better known in English as the Chinese Zodiac, is a scheme that relates each year to an animal and its reputed attributes, according to a 12-year cycle. The zodiac traditionally begins with the sign of the Rat, and the twelve zodiac signs are Rat, Ox, Tiger, Rabbit, Dragon, Snake, Horse, Ram, Monkey, Rooster, Dog and Pig. The zodiac signs cycles continuously, and determines the animal or sign under which a person is born. This year (2011, more accurately Chinese Xin Mao Year -- 3 February 2011 - 22 January 2012) is the Chinese Year of the Rabbit, so the babies born in this year are said to be born under the Chinese Zodiac sign of the Rabbit.

In China,Xusui, also known as east Asian age reckoning, is used to count a person's age. Newborns start at one year old, and each passing of a Lunar New Year, rather than the birthday, adds one year to the person's age. In other words, the first year of life is counted as one instead of zero, so that a person is two years old in their second year, three years old in their third, and so on.

Given the traditional age (Xusui) of someone, you are requested to answer his zodiac sign (Shengxiao).

Input

There are multiple test cases. The first line of input is an integerT≈ 1000 indicating the number of test cases.

Each test case contains only one positive integery≤ 200 -- the traditional age.

Output

For each test case, output a string -- the zodiac sign.

Sample Input

5
1
23
40
100
160

Sample Output

Rabbit
Snake
Rat
Rat
Rat

References


Author:WU, Zejun
Contest:The 11th Zhejiang University Programming Contest 我的解:
 1 # Set the mapping dictionary between the Chinese Zodiac and the remainder of traditional age divides 12
2 dicZodiac = { 0: 'Monkey'
3 ,1: 'Rooster'
4 ,2: 'Dog'
5 ,3: 'Pig'
6 ,4: 'Rat'
7 ,5: 'Ox'
8 ,6: 'Tiger'
9 ,7: 'Rabbit'
10 ,8: 'Dragon'
11 ,9: 'Snake'
12 ,10: 'Horse'
13 ,11: 'Ram'
14 }
15
16 print 'Please enter n as the number of cases'
17 n = input()
18 print 'Please enter each given traditional ages:'
19 resList = []
20 for i in range(0,n):
21 age = input()
22 remainder = (2011 - age + 1) % 12
23 resList.append(dicZodiac[remainder])
24 for x in resList:
25 print x
优质内容筛选与推荐>>
1、MFC单文档应用程序 修改style 光标 图标 背景 等综合
2、HTML5新特性
3、ASP.NET MVC 入门介绍 (上)
4、java实现使用QQ邮箱发送验证码功能
5、大话设计模式(一)简单工厂模式 策略模式 单一职责原则 开放-封闭原则 依赖倒置原则 装饰模式


长按二维码向我转账

受苹果公司新规定影响,微信 iOS 版的赞赏功能被关闭,可通过二维码转账支持公众号。

    阅读
    好看
    已推荐到看一看
    你的朋友可以在“发现”-“看一看”看到你认为好看的文章。
    已取消,“好看”想法已同步删除
    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号





    联系我们

    欢迎来到TinyMind。

    关于TinyMind的内容或商务合作、网站建议,举报不良信息等均可联系我们。

    TinyMind客服邮箱:support@tinymind.net.cn