Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Problema: http://www.pbinfo.ro/?pagina=probleme&id=488
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int n, v, k[10000];
- int main()
- {
- cin >> n;
- for (int i=1; i<=n; i++)
- {
- cin >> k[i];
- }
- for (int i=1; i<=n; i++)
- {
- if (i % 2 == 0)
- {
- cout << k[i] << " " ;
- }
- }
- cout << endl;
- for (int i=n; i>0; i--)
- {
- if (i % 2 == 1)
- {
- cout << k[i] << " " ;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment