Run ID:71995
提交时间:2024-04-29 19:29:49
def is_leap_year(year): # 判断是否为闰年的规则: # 1. 如果年份能被4整除,但不能被100整除,则是闰年; # 2. 如果年份能被400整除,则也是闰年。 return (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0) # 输入 t = int(input()) years = [int(input()) for _ in range(t)] # 判断每个年份是否为闰年 for year in years: if is_leap_year(year): print("Yes") else: print("No")