#C11390. Bubble Sort: Sorting Integers

    ID: 40701 Type: Default 1000ms 256MiB

Bubble Sort: Sorting Integers

Bubble Sort: Sorting Integers

Implement the bubble sort algorithm to sort a given list of integers in ascending order. The bubble sort algorithm works by repeatedly stepping through the list, comparing adjacent elements and swapping them if they are in the wrong order. This process is repeated until the list is fully sorted. Its worst-case time complexity is \(O(n^2)\), where \(n\) is the number of elements.

inputFormat

The input is provided as a single line through standard input containing a list of integers separated by spaces. For example: 4 2 3 1 5

outputFormat

The output should be a single line printed to standard output that contains the sorted integers in ascending order, separated by spaces. For example, the output for the input above will be: 1 2 3 4 5

## sample
4 2 3 1 5
1 2 3 4 5