11462-age Sort

Source: Internet
Author: User

Topic Link:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&itemid=8&page=show_problem& problem=2457

Main topic:

given an array of age data, each group has n (0<n<=2000000) data, which requires an order to be arranged from small to large, it is important to note that the input data is more likely, so you need to use a faster IO

Case:

Sample Input 53 4 2) 1 552 3 2) 3 10Sample Output1 2 3) 4 51 2 2) 3 3

Topic Analysis:

Multiple sets of data, it is important to note that the data size is variable, you can define the array outside the function body, and then use the sort function array to arrange, in addition to pay attention to the output format of the data!

Source:

1#include <cstdio>2#include <algorithm>3 using namespacestd;4 Const intmaxn=2000000;5 intA[MAXN];//function to define an array outside the body6 intN;7 intMain ()8 {9     Ten      while(SCANF ("%d", &n) &&N) One     { A          for(intI=0; i<n;i++) -scanf"%d", &a[i]);//Enter Age -Sort (a,a+n);//Sort theprintf"%d", a[0]); -           for(intj=1; j<n;j++)//Note the space output format -printf"%d", A[j]); -printf"\ n"); +     } -     return 0; +}

11462-age Sort

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.