Run ID:87029
提交时间:2024-08-01 20:14:53
def is_leap_year(year): # 判断是否为闰年的函数 if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0): return True else: return False # 输入年份 year = int(input("请输入年份:")) # 输出是否为闰年 if is_leap_year(year): print(f"{year} 是闰年。") else: print(f"{year} 不是闰年。")