Run ID:79757

提交时间:2024-07-09 23:06:40

def is_leap_year(year): return (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0) def day_of_year(year, month, day): days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] if is_leap_year(year): days_in_month[1] = 29 total_days = sum(days_in_month[:month - 1]) total_days += day return total_days def main(): year, month, day = map(int, input().split()) result = day_of_year(year, month, day) print(result) if __name__ == "__main__": main()