section3-8.cpp 455 B

1234567891011121314151617181920212223242526272829303132
  1. #include<algorithm>
  2. #include<iostream>
  3. using namespace std;
  4. int main()
  5. {
  6. int N;
  7. int *digs;
  8. int n;
  9. while (cin >> N && N) {
  10. for (int times = 0; times < N; times++) {
  11. cin >> n;
  12. digs = new int[n];
  13. for (int i = 0; i < n; i++) {
  14. cin >> digs[i];
  15. }
  16. sort(digs, digs + n);
  17. for (int i = 0; i < n; i++) {
  18. cout << digs[i];
  19. if (i != (n-1))
  20. {
  21. cout << " ";
  22. }
  23. }
  24. cout << endl;
  25. free(digs);
  26. }
  27. }
  28. return 0;
  29. }