题解 | #计算日期到天数转换#
计算日期到天数转换
http://www.nowcoder.com/practice/769d45d455fe40b385ba32f97e7bcded
常规解法
year , month , data = map(int, input().split()) month_data = [31,28,31,30,31,30,31,31,30,31,30,31] if (year % 4 == 0 and year % 100 != 0)&nbs***bsp;year % 400 == 0: month_data[1] = 29 count = 0 for i in range(month-1): count += month_data[i] print(count + data )