28 lines
1.1 KiB
Text
28 lines
1.1 KiB
Text
dateTest$ = ""
|
|
total = 0
|
|
print "Siguientes 15 fechas palindr¢micas al 2020-02-02:"
|
|
for anno = 2021 to 9999
|
|
dateTest$ = ltrim$(str$(anno))
|
|
for mes = 1 to 12
|
|
if mes < 10 then dateTest$ = dateTest$ + "0" : fi
|
|
dateTest$ = dateTest$ + ltrim$(str$(mes))
|
|
for dia = 1 to 31
|
|
if mes = 2 and dia > 28 then break : fi
|
|
if (mes = 4 or mes = 6 or mes = 9 or mes = 11) and dia > 30 then break : fi
|
|
if dia < 10 then dateTest$ = dateTest$ + "0" : fi
|
|
dateTest$ = dateTest$ + ltrim$(str$(dia))
|
|
for Pal = 1 to 4
|
|
if mid$(dateTest$, Pal, 1) <> mid$(dateTest$, 9 - Pal, 1) then break : fi
|
|
next Pal
|
|
if Pal = 5 then
|
|
total = total + 1
|
|
if total <= 15 then print left$(dateTest$,4),"-",mid$(dateTest$,5,2),"-",right$(dateTest$,2) : fi
|
|
end if
|
|
if total > 15 then break : break : break : fi
|
|
dateTest$ = left$(dateTest$, 6)
|
|
next dia
|
|
dateTest$ = left$(dateTest$, 4)
|
|
next mes
|
|
dateTest$ = ""
|
|
next anno
|
|
end
|