标签:acm 简单题 as easy as a+b hdu1040
2 3 2 1 3 9 1 4 7 2 5 8 3 6 9
1 2 3 1 2 3 4 5 6 7 8 9
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1040
做一道简单题吧,题目也说了,和A+B一样简单。
求一些数的升序,就一个排序就可以了,而且数据范围就1000.
/*******************************************
********************************************
* Author:Tree *
* From : blog.csdn.net/lttree *
* Title : As Easy As A+B *
* Source: hdu 1040 *
* Hint : 简单题 *
********************************************
*******************************************/
#include <stdio.h>
#include <algorithm>
using namespace std;
int a[1005];
int main()
{
int i,n,t;
scanf("%d",&t);
while( t-- )
{
scanf("%d",&n);
for( i=0;i<n;++i )
scanf("%d",&a[i]);
sort(a,a+n);
for( i=0;i<n-1;++i )
printf("%d ",a[i]);
printf("%d\n",a[n-1]);
}
return 0;
}
ACM-简单题之As Easy As A+B——hdu1040,布布扣,bubuko.com
ACM-简单题之As Easy As A+B——hdu1040
标签:acm 简单题 as easy as a+b hdu1040
原文地址:http://blog.csdn.net/lttree/article/details/28855499