while 1: s = input('请填入一个年份:') s = int(s) year = False if s % 100 == 0 and s % 400 == 0: year = True elif s % 100 != 0 and s % 4 == 0: year = True if year: print('闰年') else: print('平年')
本文共 283 字,大约阅读时间需要 1 分钟。
while 1: s = input('请填入一个年份:') s = int(s) year = False if s % 100 == 0 and s % 400 == 0: year = True elif s % 100 != 0 and s % 4 == 0: year = True if year: print('闰年') else: print('平年')
转载于:https://www.cnblogs.com/wumac/p/5624662.html