x=input()
year,mon,day=map(int,x.split())
if year % 4 == 0 and year % 400 != 0:
def day_run_year(year, mon, day):
"""定义闰年的月份,并返回总天数"""
sum_day = day
day_month = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
for i in day_month[0:mon]:
sum_day = sum_day + i
return sum_day
def day_ping_year(year, mon, day):
"""定义平年每月是多少天,并返回总天数"""
sum_day = day
day_month = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
for i in day_month[0:mon]:
sum_day = sum_day + i
return sum_day
# 调用函数,输出总天数
if run_year:
print(day_run_year(year, mon, day))
else:
print(day_ping_year(year, mon, day))
相关文章
- 10-10C语言 求大佬们看看哪里错了 一直显示段错误
- 10-10求各位大佬们帮我看看哪里错了