DCP-18: Number Sort Back to All Problems

Easy Beginners Problems > Ad-hoc


Tomal is learning programming recently. Being a curious computer science student, he is exploring many new programming techniques. As one of these, he has recently learnt sorting. But currently he only knows how to sort numbers. Being too excited, he is checking on all his friends who can do the same. He is very friendly and helpful person, so he likes to share his knowledge. So he always makes all his friends do the same task that he has learnt recently and now he came to know that you know programming as well. So he wants to see whether you know how to sort numbers or not. Input: ------ Input starts with an integer **T (≤ 30)**, denoting the number of test cases. Each test case will start with a positive integer **C (≤ 1000)** on a separate line denoting the total numbers in this test case that you need to sort. Next line will contain **C** numbers separated by a space which you are going to sort. Be careful; don’t predict the numbers to be only positive integers. It can be any number like 0.55, -3.2, 0, 27, 9.99, -127 etc. But none of the fraction number will have more than 2 digits after the decimal point. So you do not need to worry about precision error. Also all numbers will be in the range **(-100000 >= N <= 100000)**. Output: ------- For each test case, print the sorted **C** numbers **(sorted in ascending order and in case of tie maintain order of input)** for each test case on a single line and each number separated by a comma. Be very careful that you have to print the number exactly as you take took the input; you can’t make any change even though the value is same. For example, if number in input was “01.50” then you can’t print it as “1.5”, you have to print it exactly “01.50” after the sort is done. Also if two values tie (15.00 & 15) then print in the order you took them input. Sample Input ------------ 4 6 0.55 -3.2 0 27 9.99 -127 1 0 2 1 -1 3 5 1.0 1 Sample Output ------------- -127,-3.2,0,0.55,9.99,27 0 -1,1 1.0,1,5


Problem Setter:

MD. Jalal Uddin

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C/C++ 1.00
Java 3.00
C# 3.00
PHP 3.00

Problem Stats

101/303

Solve/Submission

Ranking

# User Language Timing
01 Salty_Coder Cpp 0.01s
02 mahbub07 Cpp 0.01s
03 seyedssz Cpp 0.01s
04 gazi93 Cpp 0.01s
05 ash12 Cpp 0.03s
06 haasib Cpp 0.11s
07 MsNahid Cpp 0.24s
08 Double_O Cpp 0.25s
09 yakin Cpp 0.25s
10 cse_nazmul Cpp 0.27s
11 Shadab Cpp 0.29s
12 Zayed Cpp 0.33s
13 Anikkhan Cpp 0.34s
14 marineCoder Cpp 0.34s
15 jalal Cpp 0.36s
16 ranit Cpp 0.36s
17 KIRIN_36 Cpp 0.44s
18 tariqiitju Cpp 0.45s
19 Amitav_Debnath_1 Cpp 0.45s
20 ArifKhanShubro Cpp 0.46s
21 chinmoysaha Cpp 0.48s
22 shahedjamil108 Cpp 0.48s
23 Zeronfinity Cpp 0.49s
24 FahimSifnatul Cpp 0.49s
25 shahad_mahmud Cpp 0.50s
26 nasif2587 Cpp 0.51s
27 moshiur_cse15 Cpp 0.52s
28 froghramar Cpp 0.52s
29 siamcr7 Cpp 0.53s
30 Robinsoncruso Cpp 0.53s
31 isat1729 Cpp 0.53s
32 NOxBODY Cpp 0.53s
33 showmic Cpp 0.55s
34 emrul Cpp 0.55s
35 Pure_Protea Cpp 0.56s
36 zyyxxx Cpp 0.57s
37 ssavi Cpp 0.65s
38 rzroky Cpp 0.69s
39 Atik_Ahamed Java 2.78s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support