vector <string> Mysplit(string str)
{
vector <string> words;
int L=str.size();
if(str[L-1]!=' '){ str=str+' ';}
int p=str.find(" ");
while (p!=-1)
{
string slovo=str.substr(0,p);
words.push_back(slovo);
str.erase(0,p+1);
p=str.find(" ");
}
return words;
}
|