Skip to content

Instantly share code, notes, and snippets.

@jtuttas
Created May 26, 2014 08:04
Show Gist options
  • Save jtuttas/a6c1029e5e2943b3c789 to your computer and use it in GitHub Desktop.
Save jtuttas/a6c1029e5e2943b3c789 to your computer and use it in GitHub Desktop.
$hmax = read-host Maximale Länge für Hypothenuse eingeben!;
for ($j=1; $j -le $hmax; $j++){
for ($k=1; $k -lt $j; $k++){
$h= [math]::Sqrt(($j * $j)+($k * $k));
if ($h % 1.0 -eq 0.0 -and $h -le $hmax){
write-host $h + $j + $k;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment