fork download
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6.  
  7. ios::sync_with_stdio(false);
  8. cin.tie(NULL);
  9.  
  10. int n;
  11. cin>>n;
  12. int arr[n];
  13. for(int i=0;i<n;++i){
  14. cin>>arr[i];
  15. }
  16. for(int i=n-1;i>=0;--i){
  17. cout<<arr[i]<<" ";
  18. }
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 5320KB
stdin
4
1 4 3 2
stdout
2 3 4 1