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 1.00
C++ 1.00
C++14 1.00
C# 3.00
Go 3.00
Java 3.00
JavaScript 3.00
Objective-C 3.00
Perl 3.00
PHP 3.00
Python 3.00
Python3 3.00
Ruby 3.00
VB.Net 3.00

Problem Stats

153/481

Solve/Submission

Ranking

# User Language Timing
01 Jubayer_Hasan Cpp14 0.00s
02 Dinar Cpp14 0.00s
03 DynamicOvi Cpp14 0.00s
04 Morass Cpp14 0.00s
05 Fahim_41 Cpp14 0.00s
06 Robbinb1993 Cpp14 0.00s
07 muntasir10mu Cpp 0.00s
08 pz1971 Cpp 0.00s
09 Nasif_44th Cpp 0.01s
10 Utshas C 0.01s
11 31_ipn Cpp 0.01s
12 seyedssz Cpp14 0.01s
13 Salty_Coder Cpp14 0.01s
14 monir769 Cpp14 0.01s
15 gazi93 Cpp14 0.01s
16 mahbub07 Cpp14 0.01s
17 feodorv Cpp14 0.01s
18 anik_JU Cpp14 0.02s
19 Riaz_BSMRSTU Cpp 0.02s
20 Taj025 CSharp 0.02s
21 sajal_khan Cpp14 0.02s
22 jalal Cpp14 0.02s
23 ash12 Cpp14 0.03s
24 Sadi9 CSharp 0.03s
25 RandyWaterhouse Python3 0.03s
26 uzzal_podder Python 0.03s
27 mhmbd CSharp 0.04s
28 tarikul_4152 Cpp 0.04s
29 afzalul Cpp14 0.04s
30 Nazmul_WUB Cpp14 0.04s
31 kpretomazi Cpp 0.05s
32 1504038_arafath Cpp 0.05s
33 mirrafa Cpp 0.05s
34 abdulmukit Cpp 0.05s
35 Rakib05 Cpp 0.05s
36 smriad Cpp14 0.08s
37 hmtanbir Cpp14 0.08s
38 rafsanulhasan CSharp 0.09s
39 sadia2427 Cpp14 0.10s
40 rockersabbir CSharp 0.10s
41 haasib Cpp14 0.11s
42 mahmud2690 Cpp14 0.12s
43 saeefad CSharp 0.12s
44 Tajulislam PHP 0.14s
45 MsNahid Cpp14 0.24s
46 Double_O Cpp14 0.25s
47 yakin Cpp14 0.25s
48 cse_nazmul Cpp14 0.27s
49 Shadab Cpp14 0.29s
50 Zayed Cpp14 0.33s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support