Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Palindromic Dates
#perl 5.22.1 my $english=1; foreach my $yyyy (2000..2999){ my $dd = substr($yyyy,3,1).substr($yyyy,2,1); my $mm = substr($yyyy,1,1).substr($yyyy,0,1); ($mm,$dd)=($dd,$mm) if $english; next if ($mm >12 or $mm ==0); if ($mm=~/^01|03|05|07|08|10|12/){ next if ($dd gt "31" or $dd eq "00"); } elsif ($mm =~/02/){ $leapYear=($yyyy % 4)||(($yyyy%100)&&!($yyyy%400)); my $FebDays=(28+($leapYear?0:1)).""; next if ($dd gt $FebDays or $dd eq "00") } else{ next if ($dd gt "30" or $dd eq "00"); } print "Month $mm,Date $dd, Year $yyyy ",$english?"$mm$dd$yyyy":"$dd$mm$yyyy", "\n"; }
run
|
edit
|
history
|
help
0
Attractive Numbers
Lieta 101733
Quote code
matrx travarsal
each_hash_function
Quotes
Perl
exam ata
Closure
Riyali-101738