Lucian_Adrian

#489 Afisare1

Nov 23rd, 2021
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int n, v[1005];
  5.  
  6. int main()
  7. {
  8. cin >> n;
  9. for(int i = 0; i < n ;++i)
  10. cin >> v[i];
  11. for(int i = 0, j = n-1 ; i <= j ; i ++, j--)
  12. {
  13. cout << v[i] << " ";
  14. if(i < j)
  15. cout << v[j] << " ";
  16. }
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment