P5737 【深基7.例3】闰年展示(py)

Ai

练一下手感

yyq=input()
s=[int(i) for i in yyq.split()]
lmq=[]
hgz=[]
Ai=0
for i in range(0,3001):
    lmq.append(0)
for i in range(s[0],s[1]+1):
#    print(i,end=' ')
    if i%100==0 :
        if i%400==0 :
            Ai+=1
            hgz.append(i)
    elif i%4==0 :
        Ai+=1
        hgz.append(i)
print(Ai)
for i in hgz:
    print(i,end=" ")




posted @ 2020-12-21 22:45  Simex  阅读(105)  评论(1编辑  收藏  举报