123456789
string test = ""; while(true) { cin.sync(); getline(cin, test ); cout << endl << "test: " << test << endl; }
1 2 3 test: 1 test: 2
1 2 3 test: 1 test: 2 test: 3
1 Test: 1 2 Test: 2 3 Test: 3
cin.sync()