现在的位置: 首页 > 综合 > 正文

hdoj 1040

2019年08月01日 ⁄ 综合 ⁄ 共 291字 ⁄ 字号 评论关闭

http://acm.hdu.edu.cn/showproblem.php?pid=1040

//水题
#include <iostream>
#include <algorithm>
using namespace std;

int main ()
{
 int t, n, i;
 int *d;
 cin >> t;
 while (t--) {
  cin >> n;
  d = (int *)malloc(sizeof(int)*n);
  for (i = 0; i < n; i++) {
   cin >> d[i];
  }
  sort (d, d+n);
  cout << d[0];
  for (i = 1; i < n; i++) {
   cout << " " << d[i]; 
  }
  cout << endl;
 }
 return 0;
}

 

【上篇】
【下篇】

抱歉!评论已关闭.