#include <iostream>
#include <string>
using namespace std;
int main ()
{
string str, result_str;
cout << "Enter string(Ctel+Z to endl):" << endl;
while(cin >> str)
{
if(result_str.empty())
{
result_str = result_str + str;
}else{
result_str = result_str + ' ' + str;
}
}
cout << "最后的字符串是:" << endl << result_str << endl;
return 0;
}
字符串的相加
最新推荐文章于 2023-06-03 23:46:17 发布