diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-05-15 18:05:15 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-05-15 18:05:15 -0500 |
commit | f2d2341ab1e322fb986a9a6ef4681234d28eabe0 (patch) | |
tree | 069aafc1f821d11223da1a142f88b22ec393c9d3 /036.pl | |
parent | db1d685414ac9257082803be8af9b27a088d8938 (diff) | |
download | projecteuler-f2d2341ab1e322fb986a9a6ef4681234d28eabe0.tar.gz projecteuler-f2d2341ab1e322fb986a9a6ef4681234d28eabe0.zip |
solution to 36
Diffstat (limited to '036.pl')
-rwxr-xr-x | 036.pl | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -0,0 +1,10 @@ +#!/usr/bin/perl +use strict; +use warnings; + +my $total = 0; +for my $n (1..1e6) { + my $n2 = sprintf "%b", $n; + $total += $n if $n eq reverse($n) and $n2 eq reverse($n2); +} +print "$total\n"; |