#题目:输入某年某月某日,判断这一天是这一年的第几天?
#分析:根据年份,判断是不是闰年,闰年规则,能被4整除且不能被400整除。
#可列表给出每月的具体天数
def Runnian(year):
return year%4 == 0 and year%400 != 0
def main():
year = int(input("year:"))
month = int(input("month:"))
day = int(input("day:"))
#years, months, days = input("请输入年月日,以英文逗号分隔:").split(",")
#year,month,day = int(years), int(moths), int(days)
DayNum1 = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
DayNum2 = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
num = 0
if Runnian(year):
for i in range(month-1):
num += DayNum1[i]
num += day
else:
for i in range(month-1):
num += DayNum2[i]
num += day
print("本日期为{}年的第{}天".format(year, num))
main()