challenges

my solutions to various "programming challenge" problems
git clone https://wehaveforgeathome.hates.computer/challenges.git
Log | Files | Refs | LICENSE

009.php (249B)


      1 <?php
      2 
      3 $a = 1;
      4 $b = 2;
      5 $c = 997;
      6 
      7 for ($a = 1; $a <= 332; $a++) {
      8   $B = floor((1000 - $a) / 2) - 1;
      9   for ($b = 2; $b <= $B; $b++) {
     10     $c = 1000 - $b - $a;
     11     if (($a * $a) + ($b * $b) == ($c * $c)) {
     12       die($a * $b * $c . "\n");
     13     }
     14   }
     15 }