2、3、5过不了,python
查看原帖
2、3、5过不了,python
929490
loren111楼主2023/3/2 09:03
n = list(map(int,input().split()))
def rn(n):
  if ((n % 400 == 0) or ((n % 4 == 0) and (n // 100 != 0))):
    return 1
  else:
    return 0

s = []
for i in range(n[0],n[1]+1):
  if rn(i):
    s.append(i)
print(len(s))
for j in s:
  print(j,end=' ')


2023/3/2 09:03
加载中...