hdu 1040 As Easy As A+B

http://acm.hdu.edu.cn/showproblem.php?pid=1040 简单排序

View Code
 1 #include<iostream>
2 #include<algorithm>
3 using namespace std;
4 const int N=1008;
5 int a[N];
6 int main()
7 {
8 int t;
9 cin>>t;
10 while(t--)
11 {
12 int n,i;
13 cin>>n;
14 for(i=0;i<n;i++) cin>>a[i];
15 sort(a,a+n);
16 for(i=0;i<n-1;i++) cout<<a[i]<<" ";
17 cout<<a[i]<<endl;
18 }
19 return 0;
20 }


 

posted @ 2012-03-31 21:22  keepmoving89  阅读(172)  评论(0编辑  收藏  举报