Special pythagorean triplet: Difference between revisions
→{{header|ALGOL W}}: Make it closer to the Wren original and small optimisations
(→{{header|ALGOL 68}}: Some optimisations) |
(→{{header|ALGOL W}}: Make it closer to the Wren original and small optimisations) |
||
Line 34:
...but doesn't stop on the first solution (thus verifying there is only one).
<lang algolw>% find the Pythagorian triplet a, b, c where a + b + c = 1000 %
for a := 1 until 1000 div 3 do begin
integer a2, b;
a2 := a * a;
for b
integer c;
c := 1000 - ( a + b );
if c
b := b + 1
end
endB:
end for_a .</lang>
{{out}}
|