读书人

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

发布时间: 2012-08-27 21:21:57 作者: rapoo

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 ;}

读书人网 >编程

热点推荐