Олимпиадный тренинг

Задача 29474. bubble sort


It is required to sort the array in non-descending order using the "bubble" method.
 
Input
The first line contains one natural number N not exceeding 1000 – array size. The second line contains N numbers – array elements (integers not exceeding 1000 in modulo).
 
Output
Output the resulting array.
 
Examples
# Input Output
1
5
5 4 3 2 1
1 2 3 4 5

Запрещенные операторы:sort