标签:mes 题目 dict src \n iter iostream tor lower
#include<iostream> #include<string> #include<set> #include<sstream> using namespace std; set<string> dic; string s, buf; int main() { while(cin >> s) { for(int i = 0; i < s.length(); i++) if(isalpha(s[i])) s[i] = tolower(s[i]); else s[i] = ‘ ‘; stringstream ss(s); while(ss >> buf) dic.insert(buf); } for(set<string>::iterator it = dic.begin(); it != dic.end(); ++it) cout << *it << "\n"; return 0; }
安迪的第一个字典 (Andy's First Dictionary,UVa10815)
标签:mes 题目 dict src \n iter iostream tor lower
原文地址:https://www.cnblogs.com/secoding/p/9490649.html