Chinese Zodiac year simple


Submit solution

Points: 5
Time limit: 1.0s
Memory limit: 64M

Authors:
Problem type
Allowed languages
Java 19, Java 8

題目說明

<修改自1122檢定考題>
讓使用者輸入一個西元年份,輸出 該年的生肖代號

2024年是龍年

輸入

西元年 (年分為>0的整數)

輸出

生肖對應的數字。
生肖對應數字如下:
鼠: 1
牛: 2
虎: 3
兔: 4
龍: 5
蛇: 6
馬: 7
羊: 8
猴: 9
雞: 10
狗: 11
豬: 0

sample input & output

樣本1 樣本2 樣本3
輸入 2024 2011 1900
輸出 5 4 1

Comments

There are no comments at the moment.