#include<cstdio> #include<iostream> #include<vector> #include<map> #include<queue> #include<algorithm> #include<deque> #include<cmath> #include<set> #include<cstring> #include<string> using namespace std; string s,str; map<string,int>m; int main() { while(getline(cin,s)&&s!="#"){ int sign=0; m.clear(); int len=s.length(); for(int i=0;i<len;i++){ str.clear(); while(s[i]>=‘a‘&&s[i]<=‘z‘){ str+=s[i++]; sign=1; } if(sign){ m[str]++; sign=0; } } int ans=m.size(); cout<<ans<<endl; } }
原文地址:https://www.cnblogs.com/frente/p/10556115.html
时间: 2024-10-12 06:53:54