#include <algorithm>
#include <vector>
#include <iterator>
#include <string>
#include <iostream>
using namespace std;
int main()
{
string strWord;
vector<string> word;
cin>>strWord;
cout<<strWord;
string::iterator start=strWord.begin();
while(start!=strWord.end())
{
string::iterator comma=find(start,strWord.end(),',');
if (comma==strWord.end())
{
word.push_back(start);
break;
}
word.push_back(string(start,comma));
start=comma;
start++;
}
for (vector<string>::iterator iter=word.begin();iter!=word.end();++iter)
{
cout<<*iter<<endl;
}
return 0;
}
提取用','分割的单词
最新推荐文章于 2023-08-05 12:00:00 发布