Sort three variables: Difference between revisions
Content added Content deleted
No edit summary |
(Add Plain English) |
||
Line 2,088: | Line 2,088: | ||
<pre>77444 -12 0 |
<pre>77444 -12 0 |
||
-12 0 77444</pre> |
-12 0 77444</pre> |
||
=={{header|Plain English}}== |
|||
This will sort integers only. |
|||
<lang plainenglish>To run: |
|||
Start up. |
|||
Sort three numbers. |
|||
Wait for the escape key. |
|||
Shut down. |
|||
To sort three numbers: |
|||
Put 77444 into an x number. |
|||
Put -12 into a y number. |
|||
Put 0 into a z number. |
|||
Write "===Before sorting===" on the console. |
|||
Write "x: " then the x on the console. |
|||
Write "y: " then the y on the console. |
|||
Write "z: " then the z on the console. |
|||
Sort the x and the y and the z. |
|||
Write "===After sorting===" on the console. |
|||
Write "x: " then the x on the console. |
|||
Write "y: " then the y on the console. |
|||
Write "z: " then the z on the console. |
|||
To sort a first number and a second number and a third number: |
|||
If the first number is greater than the second number, swap the first number with the second number. |
|||
If the second number is greater than the third number, swap the second number with the third number. |
|||
If the first number is greater than the second number, swap the first number with the second number.</lang> |
|||
{{out}} |
|||
<pre> |
|||
===Before sorting=== |
|||
x: 77444 |
|||
y: -12 |
|||
z: 0 |
|||
===After sorting=== |
|||
x: -12 |
|||
y: 0 |
|||
z: 77444 |
|||
</pre> |
|||
=={{header|PureBasic}}== |
=={{header|PureBasic}}== |