BC74 获得月份天数
思路:
step1:输入year、month;创建月份对应天数的字典;
step2:判断是否是闰年;判断是否修改天数,并打印天数;
代码如下:
while True:
try:
y,m = list(map(int,input().split()))
month = [0,31,28,31,30,31,30,31,31,30,31,30,31]
if y%400 == 0 or (y%100 != 0 and y%4 == 0):
month[2] = 29
print(month[m])
except:
break