#K53247. Correct Positions
Correct Positions
Correct Positions
You are given an unsorted array of positive integers. Your task is to sort the array so that every element is in its correct position; i.e., the array is sorted in non-decreasing order. This can be mathematically expressed as:
In this context, you can think of each number as representing a student, and sorting the array places every student in their correct spot. This is a straightforward sorting problem that tests your ability to read, process, and output data from standard input and output.
inputFormat
The first line of the input contains an integer representing the number of elements in the array. The second line contains space-separated positive integers.
outputFormat
Output a single line containing the sorted array in non-decreasing order, with each element separated by a single space.## sample
6
4 2 3 6 5 1
1 2 3 4 5 6