fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. cin >> n;
  7. int arr[n];
  8. for(int i=0; i<n; i++) cin >> arr[i];
  9. for(int u=n-1; u>-1; u--) cout << arr[u] << " ";
  10. return 0;
  11. }
Success #stdin #stdout 0s 4572KB
stdin
4
1 2 3 4
stdout
4 3 2 1