Sorting :)
Given a list of n numbers, sort them and output them one per line from smallest to largest
Input
The first line of the input contains a positive integer n no greater than 100, the number of numbers to follow.
Each line after will have a single positive integer less than 32000
Output
Output the numbers in sorted order from smallest to largest, one per line.
Sample Input
4 4 3 2 1
Sample Output
1 2 3 4
All Submissions
Best Solutions
Point Value: 5
Time Limit: 2.00s
Memory Limit: 16M
Added: Apr 08, 2011
Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3
Comments (Search)
Also, please refrain from writing actual code in comments. Admins (and in fact, people who've solved the problem) are able to look at your submissions and decide to help or not.
If your goal is to learn how to sort, then maybe not so much ...
all passed case #1;
but both got 4 in case #2?
how is this happened?
sort:
9 8 7 6 5 4 1 2 3 10 10 3 2 3 4 1 4
to:
1 2 3 4 5 6 7 8 9 10
i think these data include all possible case of this problem......
should actually be sorted to become
Specifically, that would be this line:
As an aside, no, the first case contains all unique numbers.