year = int(input(‘year:\n’))
month = int(input(‘month:\n’))
day = int(input(‘day:\n’))
“”"
1,3,5,7,8,10,12 这几月永远31天。2月平年28天,闰年(一般年份能整除4或百年年份能整除400的是闰年,)29天,其他月份30天
“”"
months = (0,31,59,90,120,151,181,212,243,273,304,334)
if 0 < month <= 12:
sum = months[month - 1]
else:
print(‘data error!’)
sum += day
leap = 0
if (year % 400 == 0) or ((year%4 == 0) and (year % 100 != 0)):
“”"
公历闰年计算方法:闰年共有366天
1、普通年能被4整除且不能被100整除的为闰年。(如2004年就是闰年,1900年不是闰年)
2、世纪年能被400整除的是闰年。(如2000年是闰年,1900年不是闰年)
"""
leap = 1
if (leap == 1) and (month > 2):
sum += 1
print(‘it is the %dth day.’ % sum)