标签:
#include<cstdio> #include<cstring> #include<iostream> #include<string> #include<set> using namespace std; int main(){ string str; set<string > q; char sss[1005]; while(gets(sss)){ str=sss; q.clear(); if(str=="#") break; int i; for(i=0;i<str.size();){ string tmp; while(str[i]>='a'&&str[i]<='z'){ tmp+=str[i]; i++; } if(tmp.size()>0) q.insert(tmp); while(str[i]==' ') i++; } printf("%d\n",q.size()); } }
标签:
原文地址:http://blog.csdn.net/cnh294141800/article/details/45206863