Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int n, v[1005];
- int main()
- {
- cin >> n;
- for(int i = 0; i < n ;++i)
- cin >> v[i];
- for(int i = 0, j = n-1 ; i <= j ; i ++, j--)
- {
- cout << v[i] << " ";
- if(i < j)
- cout << v[j] << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment