# 11462 - Age Sort

Sample Input

5

3 4 2 1 5

5

2 3 2 3 1

0

Sample Output

1 2 3 4 5

1 2 2 3 3

``` 1 #include<cstdio>
2 #include<algorithm>
3 using namespace std;
4 const int maxn=2000000;
5 int a[maxn];//函数体外定义数组
6 int n;
7 int main()
8 {
9
10     while(scanf("%d",&n)&&n)
11     {
12         for(int i=0;i<n;i++)
13            scanf("%d",&a[i]);//输入年龄
14         sort(a,a+n);//排序
15         printf("%d",a[0]);
16          for(int j=1;j<n;j++)//注意空格输出格式
17            printf(" %d",a[j]);
18         printf("\n");
19     }
20     return 0;
21 }```

## UVA之11462 - Age Sort

[题目] You are given the ages (in years) of all people of a country with at least 1 year of age. You know that no individual in that country lives for 100 or more years. Now, you are given a very simple task of sorting all the ages in ascending order.

## UVA - 11462 - Age Sort （高效算法！！）

11462 Age Sort You are given the ages (in years) of all people of a country with at least 1 year of age. You know that no individual in that country lives for 100 or more years. Now, you are given a very simple task of sorting all the ages in ascendi

## ACM比赛（11462 Age Sort)

You are given the ages (in years) of all people of a country with at least 1 year of age. You know that no individual in that country lives for 100 or more years. Now, you are given a very simple task of sorting all the ages in ascending order. Input

## COGS 1406. 邻居年龄排序[Age Sort,UVa 11462]

★   输入文件:AgeSort.in   输出文件:AgeSort.out   简单对比时间限制:1 s   内存限制:2 MB [题目描述] Mr.Zero(CH)喜闻乐见地得到了一台内存大大增强的 OI型 Apple Ⅱ,可以运行C,C++,和Pascal!为了炫耀这台高端的计算机,Mr.Zero决心将邻居们的年龄(0≤Age[i]≤120)统计后进行统计.但是,古董终究是古董,Mr.Zero拥有最多n个邻居(n≤2,400,000)但是计算机所能运行程序时的内存限制竟然达到了2MB.请你

## ACM Age Sort排序

Description Age Sort:You are given the ages (in years) of all people of a country with at least 1 year of age. You know that no individual in that country lives for 100 or more years. Now, you are given a very simple task of sorting all the ages in a

## Uva-------（11462） Age Sort(计数排序)

B Age Sort Input: Standard Input Output: Standard Output   You are given the ages (in years) of all people of a country with at least 1 year of age. You know that no individual in that country lives for 100 or more years. Now, you are given a very si

## 今日竞赛——解题报告

MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 546A Description A soldier wants to buy w bananas in the shop. He has to pay k dollars for the first banana, 2k dollars for the second one and so on (in