Run ID:67192

提交时间:2024-03-15 18:30:35

def isLeapYear(y): if y % 4 == 0: return True else: return False """ 返回True:是闰年,返回False:是平年 如果y年份是400的倍数,判定为闰年; 如果y年份是4的倍数且不是100的倍数,也判定为闰年; 上面2种情况不成立,则为平年 """ 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)