Zodiac and Leap Year
Submit solution
Points:
10 (partial)
Time limit:
1.0s
Memory limit:
64M
Authors:
Problem type
Allowed languages
Java 19, Java 8
題目說明
請撰寫一個程式,讓使用者輸入一個西元年份,判斷生肖的英文名稱與是否為閏年(閏年輸出1,否則輸出0)。
- 提示1:4的倍數是閏年,而每百年不閏、每四百年強制閏年
- 提示2:2020年是鼠年
生肖 輸出
鼠 Rat
牛 Ox
虎 Tiger
兔 Rabbit
龍 Dragon
蛇 Snake
馬 Horse
羊 Goat
猴 Monkey
雞 Rooster
狗 Dog
豬 Pig
sample input1
2024sample output1
Dragon 1sample input2
1900sample output2
Rat 0
Comments