HDU 2072 之统计不同的单纯词个数

HDU 2072 之统计不同的单词个数#includeiostream#includeset#includestringusing namespace std in

HDU 2072 之统计不同的单词个数

#include<iostream>#include<set>#include<string>using namespace std ;int main(){  string s ;  set<string> st ;  char c ;    while((c=cin.get())!='#')  {     if(c!=' ')     {      s+=c;     }     while(c!='\n')     {        while((c=cin.get())!=' '&&c!='\n')        {           s+=c;        }         if(s.length())         st.insert(s);         s="";     }            cout<<st.size()<<endl;       st.clear();  }      return 0 ;}