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. 案例研究:Web应用出现间歇性的SqlException

    案例研究:Web应用出现间歇性的SqlException 2013-07-29 14:36 by 微软互联网开发支持, 231 阅读, 3 评论, 收藏, 编辑 最近有客户找到我,说他们生产环境的事件 ...

  2. 对C# 中Readonly的再认识

    C#中有两种常量类型,分别为readonly(运行时常量)与const(编译时常量),本文将就这两种类型的不同特性进行比较并说明各自的适用场景. 工作原理    readonly为运行时常量,程序运行 ...

  3. How to make workflow chart using several tools in Linux?

    Just as what I said, I usually use yED to make workflow chart and markdown as the language to write ...

  4. 跨站请求伪造(Cross Site Request Forgery (CSRF))

    跨站请求伪造(Cross Site Request Forgery (CSRF)) 跨站请求伪造(Cross Site Request Forgery (CSRF)) 跨站请求伪造(Cross Sit ...

  5. 微软必应借PK谷歌突围中国搜索市场

    Bing“必应”是微软2009年推出的搜索品牌(http://www.bing.com),它取代的是同门师兄Live Search.进入2013年,在国内及好莱坞的多部大片里面,我都看到了Bing搜索 ...

  6. JVM内存管理学习总结(一)

    I.JVM进程的生命周期 JVM实例的生命周期和java程序的生命周期保持一致,即一个新的程序启动则产生一个新的JVM进程实例,程序结束则JVM进程实例伴随着消失.那么程序启动和程序终止就是JVM实例 ...

  7. 黑马程序员:Java基础总结----GUI图形化界面

    黑马程序员:Java基础总结 GUI图形化界面   ASP.Net+Android+IO开发 . .Net培训 .期待与您交流!   GUI(Graphical User Interface)图形化界 ...

  8. C语言相关的经典书籍(附Ebook)

    个人稍微分了一下类,有的看过,有的听人“传说过”,欢迎大家补充和共同学习. 真心经典:每个行业或者领域都有一些东西是不会随时间而逐渐消逝,以下的就是. <C语言程序设计>(第2版.新版) ...

  9. 关于国产跨平台的开源游戏引擎LGame

    声明:   本博客文章原创类别的均为个人原创,版权所有.转载请注明出处: http://blog.csdn.net/ml3947,另外本人的个人博客:http://www.wjfxgame.com. ...

  10. Android 架构艺术之MVP

    MVP是Google官方发布的Android开发相关的架构知识.本文要讲解的是一种最基本的MVP的实现方式,它使用手动的依赖注入来提供具有本地和远程数据源的存储库.异步任务处理回调. 基本的MVP的项 ...