Anonymous user
Sort three variables: Difference between revisions
m
Formatting.
(add FreeBASIC) |
m (Formatting.) |
||
Line 1,804:
=={{header|Nim}}==
<lang nim>
proc
#
while not (a <= b and b <= c):
if a > b: swap a, b
if b > c: swap b, c
proc
var (x, y, z) = (a, b, c)
echo "Before: ", x, ", ", y, ", ", z
echo "After: ", x, ", ", y, ", ", z
▲testwith(6,4,2)
▲testwith(0.9,-37.1,4.0)
▲testwith("lions","tigers","bears")</lang>
{{out}}
<pre>Before: 6, 4, 2
|