Given an array A of N integers, sort them in non-decreasing order. Input Format The…
- User
Given an array A of N integers, sort them in non-decreasing order. Input Format
The first line of the input file contains a positive integer <N. Then, N lines follow, each containing a single integer Ai, which is the i^th element of A.
Output Format
The output must contain exactly N lines, each line containing a single integer from the list, and sorted in non-increasing order.
Constraints
1 ≤ N ≤ 10,000 -10^6 ≤ Ai ≤ 10^6
SAMPLE INPUT 8 567 23 -10982 1000000 -999999 -3456 1729 65535
SAMPLE OUTPUT -999999 -10982 -3456 23 567 1729 65535 1000000
Assistant
We are asked: "Given an array A of N integers, sort them in non-decreasing order." Then sample input and output shows numbers sorted ascending (non-decreasing). But the output format says "sorted in non-increasing order"? That appears contradictory. Let's read problem statement: The description says "sort them in non-decreasing order." But output format: "The output must contain exactly N lines, each line containing a single integer from the list, and sorted in non-increasing order." Sample output: -999999 -10982 -3456 23 567 1729 65535 1000000. That's ascending (non-decreasing) from smallest to largest. That is non-decreasing, not non-increasing. So there's a mismatch. Likely a typo; the correct required order is non-decreasing (ascending). The sample matches non-decreasing.