Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 23 lines (16 sloc) 0.495 kb
1e9d384 @leto i am dumb
leto authored
1 #!/Users/jeff/Code/rakudo/perl6
2
3
4 # Problem 4
5 # 16 November 2001
6 #
7 # A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.
8 #
9 # Find the largest palindrome made from the product of two 3-digit numbers.
10
11
12 my $max = 0;
13 for (100..999) -> $x {
14 for ($x..999) -> $y {
15 my $product = $x * $y;
16
17 $max = $product if $product > $max
18 and $product eq $product.flip;
19 }
20 }
21
22 say "$max";
Something went wrong with that request. Please try again.