2020年春节期间,有一个特殊的日期引起了大家的注意:2020年2月2号。因为如果将这个日期按“yyyymmdd”的格式写成一个8位数是20200202,恰好是一个回文数。我们称这样的日期是回文日期。
def check(k): check=True y=int(k[0:4]) m=int(k[4:6]) d=int(k[6:8]) flag=0 if m<1 or m>12: check=False if (y%4==0 and y%100!=0 or y%400==0) and _______: flag=1 if check==True and (______________): check=False __________ ks=int(input()) js=int(input()) if ks>js: ks,js=js,ks lst=[31,28,31,30,31,30,31,31,30,31,30,31] s=0 for i in range(ks,js+1): k1=str(i) __________ if check(k1)==True: print(k1) s+=1 print(s)