in reply to Re: Re: Pythagorean theorem
in thread Pythagorean's theorem

#!/usr/bin/perl use strict; my $max = shift or die "Usage: $0 <max len>\n"; for my $t ( 2..sqrt$max ){ for my $s ( 1..$t-1 ){ my $c=$t*$t+$s*$s; next unless $c <= $max; my $a = $t*$t-$s*$s; my $b = 2*$s*$t; print "$a $b $c is a winner\n"; } }