fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int n;
  7. cin >> n;
  8.  
  9. int liczby[100000];
  10.  
  11. for (int i = 0; i < n; ++i) {
  12. cin >> liczby[i];
  13. }
  14.  
  15. for (int i = n / 2-1; i >= 0; i--) {
  16. cout << liczby[i] << " ";
  17. }
  18.  
  19. for (int i = n-1; i >= n / 2; i--) {
  20. cout << liczby[i] << " ";
  21. }
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0.01s 5260KB
stdin
6
3 2 1 1 2 3
stdout
1 2 3 3 2 1