Description

These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got it after many waking nights. 
Give you some integers, your task is to sort these number ascending (升序). 
You should know how easy the problem is now! 
Good luck! 
 

Input

Input contains multiple test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow. Each test case contains an integer N (1<=N<=1000 the number of integers to be sorted) and then N integers follow in the same line. 
It is guarantied that all integers are in the range of 32-int. 
 

Output

For each case, print the sorting result, and one line one case. 
 

Sample Input

2
3 2 1 3
9 1 4 7 2 5 8 3 6 9
 

Sample Output

1 2 3
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的更多相关文章

  1. CDZSC_2015寒假新人(1)——基础 i

    Description “Point, point, life of student!” This is a ballad(歌谣)well known in colleges, and you mus ...

  2. CDZSC_2015寒假新人(1)——基础 h

    Description Ignatius was born in a leap year, so he want to know when he could hold his birthday par ...

  3. CDZSC_2015寒假新人(1)——基础 g

    Description Ignatius likes to write words in reverse way. Given a single line of text which is writt ...

  4. 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 ...

  5. CDZSC_2015寒假新人(1)——基础 e

    Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever ...

  6. CDZSC_2015寒假新人(1)——基础 c

    Description FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the wareho ...

  7. CDZSC_2015寒假新人(1)——基础 b

    Description The highest building in our city has only one elevator. A request list is made up with N ...

  8. CDZSC_2015寒假新人(1)——基础 a

    Description Contest time again! How excited it is to see balloons floating around. But to tell you a ...

  9. CDZSC_2015寒假新人(2)——数学 P

    P - P Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status ...

随机推荐

  1. winsock开发重复定义问题

    参考: VS2013使用winsock.h和winsock2.h发生冲突后的终极解决方法:http://www.cnblogs.com/Shirlies/p/5137548.html WINSOCK. ...

  2. C语言enum再学习

    通常来说我们使用enum是这样的: enum week{ Mon, Tue, ... Sun }; enum week w; w = Mon; 这里默认Mon~Sun的值为0~6 也可以自己定值 , ...

  3. sql 列设置默认值,语法查询知识点积累

    一.修改字段默认值 alter table 表名 drop constraint 约束名字   ------说明:删除表的字段的原有约束 alter table 表名 add constraint 约 ...

  4. gerrit升级到16.04之后连接不到服务器

    升级到ubuntu-16.04后,发现Git-review代码报错: Unable to negotiate with 10.140.110.77 port 29418: no matching ke ...

  5. 几项有用的JQUERY代码

    检测IE浏览器 在进行CSS设计时,IE浏览器对开发者及设计师而言无疑是个麻烦.尽管IE6的黑暗时代已经过去,IE浏览器家族的人气亦在不断下滑,但我们仍然有必要对其进行检测.当然,以下片段亦可用于检测 ...

  6. tuple只有一个元素的时候,必须要加逗号

    In [1]: a = (1) In [2]: a Out[2]: 1 In [3]: a = (1,) In [4]: a Out[4]: (1,) 这是因为括号()既可以表示tuple,又可以表示 ...

  7. 通过yocto给p1010rdb定制linux,并启动linux

    一.通过yocto定制linux 1.安装yocto yocto只能在非root用户下编译,所以先新建一个用户. useradd chen  passwd -d chen 重启电脑进入chen用户. ...

  8. c# List集合排序

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  9. android导航设计

    http://www.geekpark.net/read/view/199244 Android 应用中十大导航设计错误 http://mobile.51cto.com/design-432944.h ...

  10. POJ1679(次小生成树)

    The Unique MST Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 24201   Accepted: 8596 D ...