题解 | #计算日期到天数转换#
计算日期到天数转换
http://www.nowcoder.com/practice/769d45d455fe40b385ba32f97e7bcded
yes
inport sys
a=input().split(' ')
year = int(a[0])
month = int(a[1])
day = int(a[2])
day1=0
def specialyear(n):
if n%4 ==0 and n %100 !=0:
return True
elif n % 400 == 0:
return True
else:
return False
for i in range(1,month):
if i in [1,3,5,7,8,10,12]:
day1+=31
elif i == 2:
if specialyear(year):
day1+=29
else:
day1+=28
else:
day1+=30
day1+=day
print(day1)