闰年的判断

year = int(input("请输入一个年份:"))
if (year % 400 == 0 or (year % 4 == 0 and year % 100 != 0)):
    print("您输入的年份(%d年)为闰年"%year)
else:
    print("您输入的年份(%d年)不是闰年"%year)

猜你喜欢

转载自blog.csdn.net/Angus____/article/details/81781780