Chinese Zodiac and Leap Year


Submit solution

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

Author:
Problem type

題目說明

<1122檢定考題>
讓使用者輸入一個西元年份,程式要能夠判斷 該年的生肖是否為閏年

提示1:4的倍數是閏年,而每百年不閏、每四百年強制閏年
提示2:2024年是龍年

輸入

西元年

輸出

生肖對應的數字+一個空格+閏年與否(0代表不是閏年,1代表是閏年)。
生肖對應數字如下:
鼠: 1
牛: 2
虎: 3
兔: 4
龍: 5
蛇: 6
馬: 7
羊: 8
猴: 9
雞: 10
狗: 11
豬: 12

sample input & output

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

Comments

There are no comments at the moment.