把多个字符连接成字符串
#include <iostream>
#include <string>
using namespace std;
int main()
{
string word,str;
while (cin >> word)
{
str += word;
}
cout << str << endl;
return 0;
}
用空格把输入个多个字符串分隔开来
```cpp
#include <iostream>
#include <string>
using namespace std;
int main()
{
string word,str;
while (cin >> word)
{
str += word+" ";
}
cout << str << endl;
return 0;
}