fork(6) download
  1. #include<iostream>
  2. using std::cout;
  3. using std::cin;
  4. int main()
  5. {
  6. unsigned short int t;
  7. cin >> t;
  8. while(t--)
  9. {
  10. unsigned short int n;
  11. cin >> n;
  12. int *tab=new int[n];
  13. for(unsigned short i=0;i<n;i++)
  14. {
  15. cin >> tab[i];
  16. }
  17. for(signed short i=(n-1);i>=0;i--)
  18. {
  19. cout << tab[i] << " ";
  20. }
  21. cout << "\n";
  22. delete [] tab;
  23. tab=0;
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0.01s 2816KB
stdin
5
5 1 2 3 4 5
3 5 1 1
2 3 6
6 1 2 3 4 8 9
5 3 5 7 8 9
stdout
5 4 3 2 1 
1 1 5 
6 3 
9 8 4 3 2 1 
9 8 7 5 3