HDU2072-单词数

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2072

#include<iostream>
#include<cstdio>
#include<sstream>
#include<set>
using namespace std;

set<string> words;
string str,w;

int main(){
    while(getline(cin,str)&&(str!="#")){
        istringstream sin(str);
        words.clear();
        while(sin>>w){
            words.insert(w);
        }
        cout<<words.size()<<endl;
    }
return 0;
}

猜你喜欢

转载自blog.csdn.net/yimo_180227/article/details/81990526