how to take space separated input in c++
string z,s;
while (true)
{
cin>>z;
s+=z;
if(cin.peek()=='\n')
break;
}
................................
OR\/
.................................
string s;
getline(cin,s);