Run ID:67193
提交时间:2024-03-15 18:36:43
def isLeapYear(y): """ 返回True:是闰年,返回False:是平年 如果y年份是400的倍数,判定为闰年; 如果y年份是4的倍数且不是100的倍数,也判定为闰年; 上面2种情况不成立,则为平年 """ if y%400==0: return True elif y%4==0 and y%100 !=0: return True else: return False a,b= input().split() a,b=int(a),int(b) cnt =0 for y in range(a,b+1): if isLeapYear(y): cnt +=1 print(cnt)