杭电2072

 1 //C++STL入门,set的简单应用
 2 #include<iostream>
 3 #include<string>
 4 #include<sstream>
 5 #include<set>
 6 using namespace std;
 7 set<string> dict;
 8 int main()
 9 {
10     string s,x;
11     while(getline(cin,s) && s[0] != '#')
12     {
13         dict.clear();
14         stringstream ss(s);
15         while(ss >> x)
16             dict.insert(x);
17         cout << dict.size() << endl;
18     }
19 }

 

posted @ 2017-03-26 17:31  Posase  阅读(168)  评论(0编辑  收藏  举报