Given a list of n numbers, sort them and output them one per line from smallest to largest
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 the numbers in sorted order from smallest to largest, one per line.
4 4 3 2 1
1 2 3 4
Point Value: 5
Time Limit: 2.00s
Memory Limit: 16M
Added: Apr 08, 2011
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3
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?
9 8 7 6 5 4 1 2 3 10 10 3 2 3 4 1 4
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.