Anonymous user
Pythagorean quadruples: Difference between revisions
Version 1: cleaned up the code; added a template; added missing final newline in output.
Alextretyak (talk | contribs) (Added 11l) |
(Version 1: cleaned up the code; added a template; added missing final newline in output.) |
||
Line 1,224:
===Version 1===
<lang>import math
const N = 2_200
template isOdd(n: int): bool = (n and 1) != 0
for a in 1..N:
for b in a..N:
if a.isOdd and b.isOdd: continue
for c in b..N:
d = sqrt(aabbcc.float).int
if aabbcc == d * d and d <= N: r[d] = true
for i in 1..N:
if not r[I]: stdout.write i, " "</lang>
echo()
{{out}}
|