Trocar o mínimo e o máximo

Dada uma lista de números apresentada numa única linha, a tua tarefa é identificar o valor mínimo e o máximo nessa lista e trocar os seus lugares.

O programa deve apresentar a lista resultante após a troca.

Entrada

Saída

5 1 4 3 0 -1

-1 1 4 3 0 5

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue