Sicily 1154 easy sort (SORT)

Source: Internet
Author: User

// Simple and fast sorting. It turns out that algorithm was added with qsort on Sicily. It's no wonder that an error occurred while using next_permutation during the school competition. It turns out that <algorithm> was not added! Not experienced enough !! <Br/> // The difference between poj and Sicily ...... <Br/> # include <iostream> <br/> # include <cstdio> <br/> # include <algorithm> <br/> using namespace STD; <br/> int arr [1000001]; <br/> int cmp_int (const void * a, const void * B) <br/>{< br/> int * A = (int *) A; <br/> int * B = (int *) B; <br/> return * A-* B; <br/>}< br/> int main () <br/>{< br/> int t, n; <br/> scanf ("% d", & T); <br/> while (t --) <br/>{< br/> scanf ("% d ", & N); <br/> for (INT I = 0; I <n; ++ I) <br/> {<br/> scanf ("% d ", & arr [I]); <br/>}< br/> qsort (ARR, N, sizeof (ARR [0]), cmp_int ); <br/> for (INT I = 0; I <n; ++ I) <br/> {<br/> printf ("% d/N ", arr [I]); <br/>}< br/> return 0; <br/>}< br/> 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.