Jump to content

Special pythagorean triplet: Difference between revisions

Line 119:
</pre>
 
Or, with a tiny bit of thought:
<lang jq>range(1;1000/3) as $a
| range($a+1;1000/2) as $b
| (1000 - $a - $b) as $c
| select($a*$a + $b*$b == $c*$c)
| {$a, $b, $c}</lang>
 
=={{header|Julia}}==
2,469

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.