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 = 1; i <= n ;++i)
- cin >> v[i];
- for(int i = 2 ; i <= n ; i += 2)
- cout << v[i] << " ";
- cout << endl;
- if(n%2==0)
- n --;
- for(int i = n ; i > 0 ; i -= 2)
- cout << v[i] << " ";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment