标签:
you are my friend #
4
解析:水题勿喷。。。set的简单应用~~~
AC代码:
#include <bits/stdc++.h> using namespace std; const int maxn = 10005; set<string> p; int main(){ #ifdef sxk freopen("in.txt", "r", stdin); #endif // sxk string t, s; while(getline(cin, s) && s != "#"){ int n = s.size(); p.clear(); for(int i=0; i<n; i++){ t = ""; while(s[i] >= 'a' && s[i] <= 'z') t += s[i++]; if(t != "") p.insert(t); } printf("%d\n", p.size()); } return 0; }
标签:
原文地址:http://blog.csdn.net/u013446688/article/details/45460401