daily pastebin goal
31%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl
  2.  
  3. for ($c=1;$c<=1000;$c++) {
  4.     for ($a=1;$a**2<$c**2;$a++) {
  5.         $b=1000-$a-$c;
  6. #        print "$a $b $c\n";
  7.         if (($a**2 + $b**2)==$c**2) {
  8.             print ($a*$b*$c);
  9.             print "\n";
  10.             $c=1001;
  11.         }
  12.     }
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top