Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
123104 丁俊杰 今年的第几天 Python3 Accepted 37 MS 3788 KB 477 2025-06-28 00:00:21

Tests(1/1):


Code:

#润年每个月的天数(润年2月份有29天) list1=[31,29,31,30,31,30,31,31,30,31,30,31] #平年每个月的天数(平年2月份有28天) list2=[31,28,31,30,31,30,31,31,30,31,30,31] a,b,c=map(int,input().split()) #输入年,月,日 #判断是闰年还是平年 #能被4整除,但不能被100整除;或者能被400整除的是润年 if (a%4==0 and a%100!=0) or a%400==0: res=sum(list1[:b-1])+c else: res=sum(list2[:b-1])+c print(res)