Last list item: Difference between revisions

m
(→‎{{header|ALGOL 68}}: Re-added sorted version, with the correct positioning of the new element (was wrong due to an error in translation))
m (Algol 68 →‎With sorting)
Line 12:
===With sorting===
{{trans|Wren}}
<lang algol68>BEGIN # find the last element after repeatedely adding the sum #
<lang algol68>
BEGIN # find the last element after repeatedely adding the sum #
# of the two smallest elements and removing them #
# Quicksorts in-place the array of integers a, from lb to ub #
Line 55 ⟶ 54:
OD;
print( ( "Last item is ", whole( a[ 1 ], 0 ), ".", newline ) )
END</lang>
</lang>
{{out}}
<pre>
3,028

edits