fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int* tab;
  5.  
  6. int b,n,a;
  7. float x;
  8.  
  9. int main()
  10. {
  11. cin>>n;
  12. for(int i=0; i<n;i++)
  13. {
  14. cin>>a;
  15. tab=new int[a-1];
  16. for(int j=0;j<a;j++)
  17. {
  18. cin>>b;
  19. tab[j]=b;
  20.  
  21. }
  22.  
  23. x=a;
  24. for(int j=0;j<x/2;j++)
  25. {
  26. swap(tab[j],tab[a-j-1]);
  27.  
  28. }
  29.  
  30. for(int j=0;j<a;j++)
  31. {
  32.  
  33. cout<<tab[j]<<" ";
  34.  
  35. }
  36. cout<<endl;
  37.  
  38.  
  39. delete []tab;
  40.  
  41.  
  42.  
  43.  
  44.  
  45. }
  46. return 0;
  47. }
Success #stdin #stdout 0s 4508KB
stdin
Standard input is empty
stdout
Standard output is empty