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. Matlab内置函数

    [原创]Matlab.NET混编技巧之——找出Matlab内置函数   Matlab与.NET的混合编程,掌握了基本过程,加上一定的开发经验和算法基础,肯定不难.反之,有时候一个小错误,可能抓破脑袋, ...

  2. cubie两种固定MAC地址的方法

    1.修改 /etc/init.d/networking 配置文件 在(a)代码的后面添加上(b)这段代码 (a)case "$1" in start) :5e #MAC地址可改 2 ...

  3. MessageBox, MessageBoxBurttons, MessageBoxIcon 详细解析

    [函数]:<整型> MessageBox(<字符串 Text, <字符串> Title, <整型> MessageBoxBurttons,MessageBox ...

  4. 当ArcGIS10.2遇到Teradata

                                    随着计算机技术的不断发展,GIS技术也紧跟IT技术的热潮,从三维技术.到移动技术,从大数据技术到云计算技术,只要IT有的新技术,Esri ...

  5. LearnCpp.com

    LearnCpp.com is a totally free website devoted to teaching you to program in C++. Whether you’ve had ...

  6. Android 关于ListView中按钮监听的优化问题(方法一)

    在Android应用开发过程中经常会用到ListView,并且每次在item中都要对点击事件进行监听.在给按钮添加OnClickListener时,一般会下意识的在getView()中找到每一个But ...

  7. Android中使用开源框架Fresco处理图片

    本文为原创博文,转载请注明原文链接:http://www.cnblogs.com/panhouye/p/6278116.html 关于Fresco的优点大家自行谷歌吧,它太强大太优秀了,我这一片小博文 ...

  8. struts2 ValueStack(值栈)解析

    Struts2一个重要点就是值栈. ValueStack,是用来存储一些在各个action,或者说是通过s标签.el表达式等给前台Jsp等页面展示的东西. ValueStack是一个接口,其内部接口非 ...

  9. 百度地图API的自动定位路线查询

    功能如下:打开时自动定位到当前位置(浏览器可能会屏蔽自动定位功能,建议手机查看,或直接打开地址:http://1.jingcode.applinzi.com/test2.html),输入目的地点击搜索 ...

  10. 如何编译Apache Hadoop2.2.0源代码

    转自(原文图片已丢失,本文修复图片,重新排版,并更正部分原文错误):http://www.superwu.cn/2013/12/26/913 欢迎和大家交流技术相关问题: 邮箱: jiangxinnj ...