#判断某年的第几天
days=[0,31,59,90,120,151,181,212,243,273,304,334]
year=int(raw_input(‘nian:\n‘))
month=int(raw_input(‘yue:\n‘))
day=int(raw_input(‘ri:\n‘))
if (year % 400 == 0) or (year % 4 == 0) and (year % 100 != 0):
if month >=3:
answer=days[month-1]+day+1
print ‘第‘,answer,‘天‘
else:
answer=days[month-1]+day
print ‘第‘,answer,‘天‘
else:
answer=days[month-1]+day
print ‘第‘,answer,‘天‘
时间: 2024-10-07 11:22:30