diff options
Diffstat (limited to '009.pl')
-rwxr-xr-x | 009.pl | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -0,0 +1,14 @@ +#!/usr/bin/perl +use strict; +use warnings; + +A: for my $a (1..1000) { + B: for my $b (1..(1000 - $a)) { + my $c = 1000 - $a - $b; + next A if $c <= 0; + if ($a**2 + $b**2 == $c**2) { + print "$a, $b, $c: ", $a * $b * $c, "\n"; + last A; + } + } +} |