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. WebBrowser如何获取提交的数据

    WebBrowser 其实是对 ActiveX 控件 SHDocVw 的封装,而这个SHDocVw的很多底层调用WebBrowser控件并没有提供实现,你这个应用需要直接操作 SHDoceVw 控件才 ...

  2. COMException 依赖服务或组无法启动(0x8007042C)处理办法

    问题分析:这个问题主要原因是由于服务列表中的windows management instrumentation这个服务无法启动 问题解决办法: 点击屏幕左下角:开始-运行-输入regedit 打开注 ...

  3. java静态成员的初始化过程

    public class Price{ final static Price INSTANCE = new Price(2.8); static double initPrice = 20; doub ...

  4. R语言学习笔记(数据的读取与保存)

    library(MASS)#载入package MASSdata(package="MASS") #查看MASS中的数据集data(SP500,package="MASS ...

  5. 正确看待HTML5的语法变化

    也许会有人问:“HTML4已经很普及了,如果改变基础语法,会不会有什么影响?” 我们都知道,在HMTL5之前几乎没有符合标准规范的Webu浏览器!在这种情况下,各个浏览器之间的互相兼容性和互操作性在很 ...

  6. layer 模版使用

    function doReply(id){ var url = "/Feedback/Feedback/reply"; var content = $("#reply_c ...

  7. img元素高度多出来的几像素

    HTML: <div class="test"><img src="body2.jpg" alt=""></d ...

  8. Python 之socket的应用

    本节主要讲解socket编程的有关知识点,顺便也会讲解一些其它的关联性知识: 一.概述(socket.socketserver): python对于socket编程,提供了两个模块,分别是socket ...

  9. PHP结合Linux的cron命令实现定时任务

    PHP死循环 来处理定时任务的效率是很低的.(众多网友评价)大家都建议使用Linux内置的定时任务crontab命令来调用php脚本来实现. PHP定时任务的两种方法:1.web方式调用php网页,但 ...

  10. Java所有编码问题参考手册

     一.编码基本知识 1.iso8859-1 ——属于单字节编码,最多能表示的字符范围是 0-255,应用于英文系列.比如,字母 'a' 的编码为0x61=97. 很明显,iso8859-1 编码表示的 ...