The last the largest#8962

The last the largest

1 segundo
128 megabytes
Muy fácil

Given array of integers. Find the largest element of the array that occurs the last and swap it with the last element in the array without changing the order of other elements.

Entrada

First line contains positive integer . Next line contains integers. All numbers do not exceed by absolute value.

Salida

Print the elements of updated array.

Ejemplos

Ejemplo 1

Loading
Loading