fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. int* t;
  7. cin >> n;
  8. t = new int[n];
  9. for (int i = 0; i < n; i++) {
  10. cin >> t[i];
  11. }
  12. for (int i = n - 1; i > -1; i--) {
  13. cout << t[i] << " ";
  14. }
  15. delete[] t;
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5436KB
stdin
3
1
2
3
stdout
3 2 1