Anonymous user
Perfect numbers: Difference between revisions
Updated to work with Nim 1.4. Changed indentation to conform to guidelines. Corrected the algorithm which computed an incorrect sum for square numbers.
Drkameleon (talk | contribs) No edit summary |
(Updated to work with Nim 1.4. Changed indentation to conform to guidelines. Corrected the algorithm which computed an incorrect sum for square numbers.) |
||
Line 2,354:
proc isPerfect(n: int): bool =
if q != d: inc sum, q
result = n == sum
for
echo
{{out}}
<pre>6
28
496
8128</pre>
=={{header|Objeck}}==
|