标签:out turn style else end while pre iostream space
1 #include <iostream> 2 #include <sstream> 3 #include <string> 4 #include <set> 5 6 using namespace std; 7 8 set<string> dict; 9 10 int main() 11 { 12 string s,buf; 13 14 while(cin>>s) 15 { 16 for(unsigned int i=0;i<s.length();i++) 17 { 18 if(isalpha(s[i])) 19 s[i]=tolower(s[i]); 20 else 21 s[i]=‘ ‘; 22 } 23 24 stringstream ss(s); 25 26 ss >> buf; 27 dict.insert(buf); 28 } 29 30 for(set<string>::iterator it=dict.begin();it!=dict.end();it++) 31 cout<<*it<<endl; 32 33 return 0; 34 }
标签:out turn style else end while pre iostream space
原文地址:http://www.cnblogs.com/tclan126/p/7204962.html