#include<set>
#include<string>
#include<iostream>
using namespace std;
int main()
{
set<string> exist;
char str[300];
char *l=str,*r=str;
gets(str);
while(*r!=0) {
while(*r!='.' && *r!=' ' && *r!=',' && *r!= 0)
r++;
string tmp(l,r);
if(tmp.empty())
{l++;r++;continue;}
if(exist.find(tmp) == exist.end())
{cout<<tmp<<' ';exist.insert(tmp);}
else
{r++;l=r;}
}
cout<<endl;
return 0;
}
test3
最新推荐文章于 2023-08-15 10:54:36 发布