{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\n \u003cspan class\u003d\"solution-visible-txt\"\u003e\u003c/span\u003e\n \u003cp\u003e\u003cb\u003eNote: This problem is purely for practice submissions, and will be excluded while making the final ranklist. You are free to make as many/as few submissions on it as you like, and there will be no penalty in the end. If you wish, you may choose to not solve the problem at all, and there will still be no loss.\u003c/b\u003e\u003cbr\u003e \u003c/p\u003e\n\u003cp\u003eSorting an array. A problem which seems so simple, yet has so many methods. This problem is intended to teach you a couple of the better ones.\u003cbr\u003e\nYou probably already know of a way to sort an array - bubble sort, insertion sort, perhaps even selection sort. But there are better ways. Faster ways. Easier ways. And without using those, this problem (and the rest) will elude your grasp for all eternity.\u003cbr\u003e\u003c/p\u003e\n\u003cp\u003eThe easiest way to sort is going to be your language\u0027s built-in sort function. \u003cbr\u003e\nC++ - If you\u0027re using \u003ca href\u003d\"https://www.geeksforgeeks.org/sort-algorithms-the-c-standard-template-library-stl/\"\u003earrays\u003c/a\u003e (Requires \u003ca href\u003d\"http://www.cplusplus.com/reference/algorithm/\"\u003ealgorithm\u003c/a\u003e header)\u003cbr\u003e\nC++ - If you\u0027re using \u003ca href\u003d\"http://www.cplusplus.com/reference/algorithm/sort/\"\u003evectors\u003c/a\u003e.\n(Requires \u003ca href\u003d\"http://www.cplusplus.com/reference/algorithm/\"\u003ealgorithm\u003c/a\u003e header) \u003cbr\u003e\nJava - see \u003ca href\u003d\"https://www.geeksforgeeks.org/sorting-in-java/\"\u003ethis\u003c/a\u003e.\u003cbr\u003e\nPython - \u003ca href\u003d\"https://docs.python.org/3/howto/sorting.html#sortinghowto\"\u003eDocumentation\u003c/a\u003e is your best friend.\u003cbr\u003e\nAny other language - you most likely have a built-in sort function, so look it up and use it.\u003cbr\u003e\nIn case you absolutely do not have (or do not want to use) the sort function provided, you will have to write your own. For this, look up \u003ca href\u003d\"https://en.wikipedia.org/wiki/Merge_sort\"\u003emerge sort\u003c/a\u003e and/or \u003ca href\u003d\"https://en.wikipedia.org/wiki/Quicksort\"\u003equicksort\u003c/a\u003e.\u003cbr\u003e\u003cbr\u003e\nIf this is your first time using these sort functions, I recommend taking a little time to play around with what they can do, and getting used to them. Saves a lot of headache in the future.\u003cbr\u003e\n\u003cbr\u003e\nYour task for this program is simple: you are provided an array. Sort it in ascending order, and print it back. That\u0027s it. Simple, right?\n\n \u003ch3\u003eInput\u003c/h3\u003e \n \u003cp\u003eThe first line contains one integer \u003ci\u003en\u003c/i\u003e (\u003ci\u003en\u003c/i\u003e ≤ 10\u003csup\u003e6\u003c/sup\u003e) – the number of integers in the array. \u003ci\u003en\u003c/i\u003e lines follow. \u003cbr\u003e Each line contains one integer: \u003ci\u003ex\u003c/i\u003e (0 ≤ \u003ci\u003ex\u003c/i\u003e ≤ 10\u003csup\u003e6\u003c/sup\u003e), representing the elements of the array. \u003c/p\u003e\n \u003ch3\u003eOutput\u003c/h3\u003e \n \u003cp\u003eOutput the given array in ascending order.\u003cbr\u003e \u003c/p\u003e\n \u003ch3\u003eExample\u003c/h3\u003e \n \u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e\u003c/p\u003e \n \u003cpre\u003e5\n5\n3\n6\n7\n1\n\u003c/pre\u003e \n \u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e\u003c/p\u003e \n \u003cpre\u003e1\n3\n5\n6\n7\n\u003c/pre\u003e\n \u003c/body\u003e\n\u003c/html\u003e"}}]}