fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int MAX_SIZE = 100000;
  5.  
  6. int main() {
  7. int n, v[MAX_SIZE];
  8. cin >> n;
  9. for (int i = 0; i < n; ++i) {
  10. cin >> v[i];
  11. }
  12. for (int i = 0; i < n / 2; ++i) {
  13. const int aux = v[i];
  14. v[i] = v[n - 1 - i];
  15. v[n - 1 - i] = aux;
  16. }
  17. for (int i = 0; i < n; ++i) {
  18. cout << v[i] << " ";;
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0s 5220KB
stdin
Standard input is empty
stdout
Standard output is empty