#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
vector<char> a(n);
copy(istream_iterator<char>(cin),istream_iterator<char>(),a.begin());
copy(a.begin(),a.end(),ostream_iterator<char>(cout," "));
return 0;
}
in the 7th line, to stop the istream_iterator
needs to be stopped explicitly by pressing Ctrl + z
Else the istream_iterator
continues to expect input and it is stuck there until the user presses Ctrl + Z
and then the rest of code is executed