CDZSC_2015寒假新人(1)——基础 d
Description
Give you some integers, your task is to sort these number ascending (升序).
You should know how easy the problem is now!
Good luck!
Input
It is guarantied that all integers are in the range of 32-int.
Output
Sample Input
3 2 1 3
9 1 4 7 2 5 8 3 6 9
Sample Output
1 2 3 4 5 6 7 8 9
- #include<iostream>
- #include<cstring>
- #include<cstdio>
- #include<algorithm>
- using namespace std;
- int main()
- {
- int n,m,a[];
- scanf("%d",&m);
- while(m--)
- {
- scanf("%d",&n);
- for(int i=;i<n;i++)
- {
- scanf("%d",&a[i]);
- }
- sort(a,a+n);
- for(int i=;i<n-;i++)
- {
- printf("%d ",a[i]);
- }
- printf("%d\n",a[n-]);
- }
- }
CDZSC_2015寒假新人(1)——基础 d的更多相关文章
- CDZSC_2015寒假新人(1)——基础 i
Description “Point, point, life of student!” This is a ballad(歌谣)well known in colleges, and you mus ...
- CDZSC_2015寒假新人(1)——基础 h
Description Ignatius was born in a leap year, so he want to know when he could hold his birthday par ...
- CDZSC_2015寒假新人(1)——基础 g
Description Ignatius likes to write words in reverse way. Given a single line of text which is writt ...
- CDZSC_2015寒假新人(1)——基础 f
Description An inch worm is at the bottom of a well n inches deep. It has enough energy to climb u i ...
- CDZSC_2015寒假新人(1)——基础 e
Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever ...
- CDZSC_2015寒假新人(1)——基础 c
Description FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the wareho ...
- CDZSC_2015寒假新人(1)——基础 b
Description The highest building in our city has only one elevator. A request list is made up with N ...
- CDZSC_2015寒假新人(1)——基础 a
Description Contest time again! How excited it is to see balloons floating around. But to tell you a ...
- CDZSC_2015寒假新人(2)——数学 P
P - P Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status ...
随机推荐
- javaScript增加样式规则(新增样式)
<html> <head> <link rel="stylesheet" type="text/css" href="b ...
- java学习基础
Q: What if the static modifier is removed from the signature of the main method? A: Program compiles ...
- uva 12100 Printer Queue
The only printer in the computer science students' union is experiencing an extremely heavy workload ...
- 对面试题(剑指offer)产生的一些思考。
零散的思绪.另外,推荐<剑指offer>.本文初期大部分思考都从剑指引发. 面试题不单单只是用来面试.其中有很多编程的经验可以学习.就如同我们当年的考试:) 1:鲁棒性的一个方面:边界条件 ...
- 解决: AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]}
关于Gradle Console输出类似这样错误信息: AGPBI: {"kind":"error","text":"indica ...
- python-整理--连接MSSQL
环境 : python3.4 / win10 / vs2013 / sqlexpress2014 需要的工具和包 1.freetds包 下载地址 https://github.com/ramiro/f ...
- bzoj1864 [Zjoi2006]三色二叉树
Description Input 仅有一行,不超过500000个字符,表示一个二叉树序列. Output 输出文件也只有一行,包含两个数,依次表示最多和最少有多少个点能够被染成绿色. Sample ...
- Climbing Stairs 解答
Question You are climbing a stair case. It takes n steps to reach to the top. Each time you can eith ...
- Rightmost Digit(快速幂+数学知识OR位运算) 分类: 数学 2015-07-03 14:56 4人阅读 评论(0) 收藏
C - Rightmost Digit Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit ...
- UGUI Silder
来我们看看这个像温度计的控件, 比如音量面板声音大小的控制.它是一个组合型控件由多个Image 和一个Slider组合而成 它的核心是Slider组件实现的. 简单介绍下Slider组件的属性: Fi ...