Function for the sum of the minimum and the maximum of three integers X46340


Statement
 

pdf   zip   main.cc

html

Implementa function

int sum_min_max(int x, int y, int z);

which given three numbers returns the sum of their minimum and maximum values. Input

Input consists of three integer numbers.

Precondition

It holds 0 < x, y, z < 109.

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

Public test cases
  • Input/Output

    sum_min_max(736, 291, 348) → 1027
    sum_min_max(12, -569, 666) → 97
    sum_min_max(23, 22, 20) → 43
  • Information
    Author
    Maria Serna
    Language
    English
    Translator
    Maria Serna
    Original language
    Catalan
    Other languages
    Catalan Spanish
    Official solutions
    Unknown.
    User solutions
    C++