Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
71930 展博 今年的第几天 Python3 Accepted 32 MS 3776 KB 383 2024-04-28 17:37:11

Tests(1/1):


Code:

def day_of_year(year, month, day): days_per_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0): days_per_month[1] = 29 total_days = sum(days_per_month[:month - 1]) total_days += day return total_days a,b,c=input().split() a,b,c=int(a),int(b),int(c) print(day_of_year(a,b,c))