第2个回答 2012-11-24
string catsting(string Srcstr)
{
string dststr;
size_t posstion = 0;
while(Srcstr.size() != 0)
{
if(string::npos != Srcstr.find_first_of(" "))
{
posstion = Srcstr.find_first_of(" ");
string tmpstr (Srcstr,0,posstion);
dststr += tmpstr;
Srcstr =Srcstr.erase(0,posstion+1 );
}
else
break;
}
dststr += Srcstr;
return dststr;
}
调试通过的!