uva 11462 Age Sort

简介: 点击打开链接uva 11462 水题 #include#include#include#includeusing namespace std;const int maxn = 2000010;int num[maxn];i...

点击打开链接uva 11462

水题

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;

const int maxn = 2000010;
int num[maxn];
int n;

int main(){
    while(scanf("%d" , &n) && n){
       for(int i = 0 ; i < n ; i++) 
          scanf("%d" , &num[i]);
       sort(num , num+n);
       printf("%d" , num[0]);
       for(int i = 1 ; i < n ; i++)
          printf(" %d" , num[i]);
       printf("\n"); 
    }
    return 0;
}




相关文章
LeetCode 307. Range Sum Query - Mutable
update(i, val) 函数可以通过将下标为 i 的数值更新为 val,从而对数列进行修改。
114 0
LeetCode 307. Range Sum Query - Mutable
LeetCode 357. Count Numbers with Unique Digits
给定一个非负整数 n,计算各位数字都不同的数字 x 的个数,其中 0 ≤ x < 10n 。
121 0
LeetCode 357. Count Numbers with Unique Digits
SELECT * FROM GIRLS WHERE AGE BETWEEN 20 AND 24 ...
阿粉最近看到一张图,如上所示,原本只是一个搞笑的图,但是在阿粉看来这分明是个渣男啊!一句普通的 SQL 语句SELECT * FROM GIRLS WHERE AGE BETWEEN 20 AND 24 AND BOYFRIEND IS NULL,也有很多内涵! 什么?没看出来?来,阿粉带你品品。
SELECT * FROM GIRLS WHERE AGE BETWEEN 20 AND 24 ...
[LeetCode]--303. Range Sum Query - Immutable
Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Given nums = [-2, 0, 3, -5, 2, -1] sumRange(0, 2) -&gt; 1 sumRange(2, 5) -&
1030 0
[LeetCode]--26. Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this in p
983 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等