Special pythagorean triplet: Difference between revisions

→‎{{header|ALGOL 68}}: Remove possibly invalid optimisation
(→‎{{header|ALGOL 68}}: Remove possibly invalid optimisation)
Line 11:
# a + b + c = 1000, a2 + b2 = c2, a < b < c #
INT sqrt 1000 = ENTIER sqrt( 1000 );
FOR n TO sqrt 1000 OVER 2 DO
FOR m FROM n + 1 TO sqrt 1000 DO
# a = m^2 - n^2, b = 2mn, c = m^2 + n^2 ( Euclid's formula ), so #
3,038

edits