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 ...
随机推荐
- scrollview不能滚动
1. 图片视图上不能直接滚动,需要设置交互属性为YES _contentView = [[UIImageView alloc]initWithFrame:CGRectMake(0, _headerVi ...
- -canOpenURL: failed for URL
这在 Xcode 6.4 + iOS 8 时,是不会有的情况,原因是[为了强制增强数据访问安全, iOS9 默认会把所有从NSURLConnection . CFURL . NSURLSession发 ...
- C++服务器设计(六):设备连接的生命周期管理
生命周期介绍 每一个服务器系统的新连接从建立开始时,均会经历多个阶段.比如连接的建立,登录的验证,退出前的资源释放等.同时在具体的消息处理中,还会遇到不可识别的消息事件,或者消息处理时出现数据错误等. ...
- (转) Eclipse - Python - Installation of PyDev with a Python Hello World tutorial
Once you finished your installation of Python on your Windows OS, GNU/Linux or Mac OS, let me tell ...
- CSS中文字体的英文名称(simsun)宋体,(Microsoft YaHei)微软雅黑
CSS中文字体的英文名称(simsun)宋体,(Microsoft YaHei)微软雅黑 华文细黑:STHeiti Light [STXihei] 华文黑体:STHeiti 华文楷体:STKaiti ...
- js特殊字符转义
点的转义:. ==> \\u002E 美元符号的转义:$ ==> \\u0024 乘方符号的转义:^ ==> \\u005E 左大括号的转义:{ ==> \\u007B 左方括 ...
- 15个顶级Java多线程面试题及回答
Java 线程面试问题 在任何Java面试当中多线程和并发方面的问题都是必不可少的一部分.如果你想获得任何股票投资银行的前台资讯职位,那么你应该准备很多关于多线程 的问题.在投资银行业务中多线程和并发 ...
- Travel(HDU 5441 2015长春区域赛 带权并查集)
Travel Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Su ...
- jdbc 通过rs.getString()获取数据库中的时间字段问题
例如在mysql中的一张表中存在一个字段opr_time为datetime类型, 在JDBC 中通过rs.getString("opr_time");来获取使会在日期后面添加&qu ...
- WebSocket C# Demo
WebSocket 规范 WebSocket 协议本质上是一个基于 TCP 的协议.为了建立一个 WebSocket 连接,客户端浏览器首先要向服务器发起一个 HTTP 请求,这个请求和通常的 HTT ...