Today   (2020-02-02,   at the time of this writing)   happens to be a palindrome,   without the hyphens,   not only for those countries which express their dates in the   yyyy-mm-dd   format but,   unusually,   also for countries which use the   dd-mm-yyyy   format.



Task
Write a program which calculates and shows the next 15 palindromic dates for those countries which express their dates in the   yyyy-mm-dd   format.




 
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
 