As Easy As A+B

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 53368    Accepted Submission(s): 22939

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
 #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int test, n;
cin >> test; while(test--)
{
vector<int> v;
cin >> n;
for(int i = ; i < n; i++)
{
int temp;
cin >> temp;
v.push_back(temp);
}
sort(v.begin(), v.end());
for(int i = ; i < n; i++)
{
if(i == )
cout << v[i];
else
cout << " " << v[i];
}
cout << endl;
}
return ;
}

hdu 1040 As Easy As A+B的更多相关文章

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

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

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

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

  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 (排序。。。水题)

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

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

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

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

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

  7. hdu 5058 So easy

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

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

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

  9. HDU 5475 An easy problem 线段树

    An easy problem Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pi ...

随机推荐

  1. Linux Vi 删除全部内容,删除某行到结尾,删除某段内容 的方法

    1.打开文件 vi filename 2.转到文件结尾 G 或转到第9行 9G 3.删除所有内容(先用G转到文件尾) ,使用: :1,.d 或者删除第9行到第200行的内容(先用200G转到第200行 ...

  2. CentOS上安装MySQL

    1.准备RPM安装包 MySQL-server-5.6.33-1.linux_glibc2.5.x86_64 MySQL-client-5.6.33-1.linux_glibc2.5.x86_64 2 ...

  3. matlab 函数说明—ordfilt2

    今天看harris角点实现的源码,在某一个版本中看到了这个函数,不是很理解,doc ordfilt2之后还是不清楚,终于在matlab论坛上搞清楚了ordfilt2的功能.   中文理解函数名就是顺序 ...

  4. 【转载】awk简介

    [转载自]http://www.cnblogs.com/ggjucheng/archive/2013/01/13/2858470.html 简介 awk是一个强大的文本分析工具,相对于grep的查找, ...

  5. AVLTree的节点删除

    当年实现自己的共享内存模板的时候,map和set的没有实现,本来考虑用一个AVLTree作为底层实现的,为啥,因为我当时的数据结构知识里面我和RBTree不熟,只搞过AVLTree,但当时我一直没有看 ...

  6. TextView & EditText

    TextView 1.下划线 textView.getPaint().setFlags(Paint. UNDERLINE_TEXT_FLAG ); //下划线 2.单独做第一步,文字会出现锯齿,要加下 ...

  7. ActivityNotFoundException: No Activity found to handle Intent

    代码如下: Intent intent = new Intent(); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setAction ...

  8. JQuery事件处理的注意事项

    1.jQuery 名称冲突 jQuery 使用 $ 符号作为 jQuery 的简介方式. 某些其他 JavaScript 库中的函数(比如 Prototype)同样使用 $ 符号. jQuery 使用 ...

  9. Oracle- PL/SQL DEV的远程配置

    首先装好Oracle企业版或者客户端精简版.之后要修改你的的tnsnames.ora文件,来增加数据库. 我的ORACLE实例是ORACLE1,放在D:\oracle\ 目录下.我的IP地址是 192 ...

  10. PowerDesigner 企业架构模型 ( EAM )

    PowerDesigner 企业架构模型 ( EAM ) 说明 file工作数据库框架application网络   目录(?)[+]   一. 企业架构模型 说明 EnterpriseArchite ...