1string z,s;
2 while (true)
3 {
4 cin>>z;
5 s+=z;
6 if(cin.peek()=='\n')
7 break;
8 }
9................................
10 OR\/
11.................................
12string s;
13getline(cin,s);
1// extract to string
2#include <iostream>
3#include <string>
4
5int main ()
6{
7 std::string name;
8
9 std::cout << "Please, enter your full name: ";
10 std::getline (std::cin,name);
11 std::cout << "Hello, " << name << "!\n";
12
13 return 0;
14}