题解 | 获得月份天数
获得月份天数
https://www.nowcoder.com/practice/13aeae34f8ed4697960f7cfc80f9f7f6
def compute(year, month):
if month == 2:
if year % 400 == 0 or (year % 100 != 0 and year % 4 == 0):
return 29
else:
return 28
if month == 1 or month == 3 or month == 5 or month == 7 or month == 8 or month == 10 or month == 12:
return 31
else:
return 30
while True:
try:
year, month = map(int, input().split())
print(compute(year, month))
except:
break


