Sort three

Write a procedure

    void sort3(int& a, int& b, int& c);

to sort @a@, @b@ and @c@ in nondecreasing order. For instance, if called with @a@ =7=7, @b@ =3= -3 and @c@ =1= 1, the values after the call must be @a@ =3=-3, @b@ =1= 1 and @c@ =7= 7.

Observation

You only need to submit the required procedure; your main program will be ignored.

Problem information

Author: Unknown
Translator: Salvador Roura

Generation: 2026-01-25T10:16:58.332Z

© Jutge.org, 2006–2026.
https://jutge.org