As Easy As A+B

Problem 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
 
Answer
水题,从小到大排序。不舒服,水水更健康~
 
#include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <vector>
#define PI acos(-1.0)
#define ms(a) memset(a,0,sizeof(a))
#define msp memset(mp,0,sizeof(mp))
#define msv memset(vis,0,sizeof(vis))
#define msd memset(dp,0,sizeof(dp))
using namespace std;
//#define LOCAL
int main()
{
#ifdef LOCAL
freopen("in.txt", "r", stdin);
//freopen("out.txt","w",stdout);
#endif // LOCAL
ios::sync_with_stdio(false);
int N;
cin>>N;
while(N--)
{
int n;
cin>>n;
vector<int> v;
v.clear();
for(int i=;i<n;i++)
{
int t;
cin>>t;
v.push_back(t);
}
sort(v.begin(),v.end());
printf("%d",v[]);
for(vector<int>::iterator it=v.begin()+;it!=v.end();it++)
{
printf(" %d",*it);
}
printf("\n");
}
return ;
}

HDU 1040 As Easy As A+B(排序)的更多相关文章

  1. HDU 1040 As Easy As A+B (排序。。。水题)

    题意:给定n个数,让你从小到大排序. 析:不说什么了. 代码如下: #include <cstdio> #include <iostream> #include <cst ...

  2. hdu 1040 As Easy As A+B(排序)

    题意:裸排序 思路:排序 #include<iostream> #include<stdio.h> #include<algorithm> using namesp ...

  3. HDU 1040.As Easy As A+B【排序】【如题(水!水!水!)】【8月24】

    As Easy As A+B Problem Description These days, I am thinking about a question, how can I get a probl ...

  4. hdu 1040 As Easy As A+B

    As Easy As A+B Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) T ...

  5. HDU 1040 As Easy As A+B [补]

    今天去老校区找她,不想带电脑了,所以没时间A题了 /*******************************************************************/ As Ea ...

  6. HDU 5572 An Easy Physics Problem (计算几何+对称点模板)

    HDU 5572 An Easy Physics Problem (计算几何) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5572 Descripti ...

  7. 杭电 1040 As Easy As A+B 【排序】

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1040 解题思路:数据不大,可以直接用冒泡排序 #include<stdio.h> int ...

  8. hdu 5058 So easy

    题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5058 So easy Description Small W gets two files. Ther ...

  9. hdu 5475 An easy problem(暴力 || 线段树区间单点更新)

    http://acm.hdu.edu.cn/showproblem.php?pid=5475 An easy problem Time Limit: 8000/5000 MS (Java/Others ...

随机推荐

  1. Object-c学习之路五(@protocol协议)

    今天模拟Button的delegate来联系一下protocol. Button类 // Button.h // Protocal // // Created by WildCat on 13-7-2 ...

  2. Make Things Move -- Javascript html5版(二)实现最基本的Sprite类和stage管理对象

    现在这几篇写的都是比较基础的东西,有过相应开发经验的朋友可直接忽略啦. 计算机模拟的动画都是由很多静态的一连串影像(sprite)在一定帧率(fps)内逐帧播放出来的. 对于js来说,我们可以用提供的 ...

  3. C# 枚举常用工具方法

    /// <summary> /// 获取枚举成员描述信息及名称 /// 返回:IDictionary /// Value:描述信息 /// Key:值 /// </summary&g ...

  4. easyui小清新俺也晒晒 视频管理软件bs项目

    easyui小清新俺也晒晒 视频管理软件bs项目 针对设备的管理软件 这是我听到最多的话.视频管理软件bs项目.easyui 好与坏我不去评价 项目做了好几个月,其实代码看来也没用多少,但是做需求,时 ...

  5. Excel 自定义函数

    浅谈Excel开发:四 Excel 自定义函数   我们知道,Excel中有很多内置的函数,比如求和,求平均,字符串操作函数,金融函数等等.在有些时候,结合业务要求,这些函数可能不能满足我们的需求,比 ...

  6. tar命令,重定向,正则表达式,添加删除用户,tr命令,sort排序

    rpm包仅用于 redhat suse redflag 若是源代码包的话,那就都适用linux下面的备份,差不多就是用tar打包 tar命令用途:制作归档文件,释放归档文件格式:tar [选项]... ...

  7. Introduction to OOC Programming Language

    Introduction to OOC Programming Language 文/akisann @ cnblogs.com / zhaihj @ github.com 本文同时发布在github ...

  8. KnockOut文档--模板绑定

    目的 模板绑定使用数据render模板,然后把渲染的结果填充到Dom树中.模板通过重复或嵌套块(通常为您的视图模型数据的函数)用一种简单,方便的方式来建立复杂的UI结构 . 有两种方式使用模板: Na ...

  9. replace()随笔

    今天在读jquery源码时,发现一个以前自己不曾注意过得问题,就是replece()的第二个参数为函数时的问题,以前只是知道replace()的第二个参数可以为函数,但是不知道该怎么操作,今天看到源码 ...

  10. CentOS 下搭建部署独立SVN服务器全程详解(5.5)

    SVN服务器有2种运行方式: 1.独立服务器(例如:svn://xxx.com/xxx): 2.借助apache   (例如:http://svn.xxx.com/xxx): 为了不依赖apache, ...