year = int(input("请输入一个年份:"))
if (year % 400 == 0 or (year % 4 == 0 and year % 100 != 0)):
print("您输入的年份(%d年)为闰年"%year)
else:
print("您输入的年份(%d年)不是闰年"%year)
闰年的判断
最新推荐文章于 2023-05-29 17:59:40 发布
year = int(input("请输入一个年份:"))
if (year % 400 == 0 or (year % 4 == 0 and year % 100 != 0)):
print("您输入的年份(%d年)为闰年"%year)
else:
print("您输入的年份(%d年)不是闰年"%year)