Sort three values

  1. Design a function @ordena3(a, b, c)@ which, given three values returns them sorted. This function must be solved with all necessary if analyzing all possible cases: when aa is greater than bb and cc, when bb is greater than aa and cc, and so on.

  2. Design a function @ordena2(a, b)@ that given two values returns them sorted.

  3. Design a function @ordena3_2a2(a, b, c)@ that given three values returns them sorted. This function cannot contain any if and must be solved calling function @ordena2(a, b)@ from previous point.

Scoring

The first two points are worth 30 points. The last one is worth 40 points.

Sample session

Problem information

Author: InfBesos

Generation: 2026-01-25T14:15:56.232Z

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