Advertisement
elephantsarecool

2pol

Jan 11th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include<iostream>
  2. #include<vector>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x[1000];
  7.     vector<int> y;
  8.     int n;
  9.     cin>>n;
  10.     for(int i=0;i<n;++i)
  11.         cin>>x[i];
  12.     for(int i=1;i<n;i+=2)
  13.     {
  14.         y.push_back(x[i]);
  15.         cout<<x[i]<<' ';
  16.     }
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement