3用python编程判断输入年份是否为闰年年份能被400整除或者能被4整除但不能被100整除
year = int(input("请输入一个年份:"))
if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0): print(f"{year}年是闰年") else: print(f"{year}年不是闰年")

原文地址: http://www.cveoy.top/t/topic/Z35 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
year = int(input("请输入一个年份:"))
if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0): print(f"{year}年是闰年") else: print(f"{year}年不是闰年")
原文地址: http://www.cveoy.top/t/topic/Z35 著作权归作者所有。请勿转载和采集!