Advertisement
yejolga

ol_5_03

Nov 4th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     ifstream cin("input.txt");
  10.  
  11.     int n;
  12.     cin>>n;
  13.  
  14.     string e = "";
  15.     for(int i = 0; i < n; i++)
  16.     {
  17.         string cur;
  18.         cin>>cur;
  19.         if (i%2 == 0)
  20.             cout<<cur<<' ';
  21.         else
  22.             e += cur + ' ';
  23.     }
  24.     cout<<e;
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement