hdoj 1040 sort排序
来源:互联网 发布:天眼软件下载 编辑:程序博客网 时间:2024/05/21 19:34
As Easy As A+B
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 40558 Accepted Submission(s): 17479
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<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int m,n,i,a[10010];
cin>>m;
while(m--)
{
cin>>n;
for(i=0;i<n;i++)
cin>>a[i];
sort(a,a+n);
for(i=0;i<n-1;i++)
{
cout<<a[i]<<" ";
}
cout<<a[n-1]<<endl;
}
//system("pause");
return 0;
}
- hdoj 1040 sort排序
- HDOJ 5240 Exam 【sort排序&&模拟】
- hdoj Sort it 2689 (归并排序)
- HDOJ(HDU) 2523 SORT AGAIN(推导排序、、)
- hdoj 1862 EXCEL排序 【结构体+sort】
- HDOJ 1425 sort (堆排序NlogN)
- hdoj 1082 excel 排序(结构体+sort排序)
- HDOJ EXCEL排序 1862(sort排结构体)
- HDOJ 1236 排名(结构体成员的 sort 排序方法)
- hdoj--1862 EXCEL排序(sort+结构体)
- hdoj 开门人和关门人(sort排序+结构体)
- hdoj-2014 青年歌手大奖赛_评委会打分【sort排序||冒泡排序】
- HDOJ 1425: Sort
- HDOJ 1425 (sort)
- HDOJ 1425 sort
- hdoj 1890 Robotic Sort
- HDOJ 1425 : Sort
- HDOJ 1890 Robotic Sort
- 那些开发中用到的模式——访问者模式
- m*n格填数方案
- 2014年底和之前同时讨论研发绩效考核的总结
- Java技术丛书
- Open-source Project官方地址
- hdoj 1040 sort排序
- 转载《WPF之Binding深入探讨》
- 【mfc】用对话框分页实现用户登录
- CGAL编程实现点集的Delaunay三角剖分和Voronoi图
- 【Software】通过google chrome下载网络视频的方法
- POJ 3268 Silver Cow Party(最短路dijkstra)
- question2answer设置邮件通知
- cocos2d-x 中添加显示文字的三种方式 LabelTTF 、LabelBMFont 和 LabelAtlas
- Java过滤器InputFilter