def is_leap_year(year): # 判断是否是闰年 return (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0) def day_of_year(year, month, day): # 检查年份合法性 if not (1000 <= year <= 9999): return "年份不合法" # 每个月的天数 days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] # 如果是闰年,修改二月的天数 if is...