close
題目:
https://vjudge.net/problem/UVA-10815
C++:
#include <iostream> #include <sstream> #include <set> using namespace std; int main() { string s, t; set <string> st; while (cin >> s) { for (int i = 0; i < s.size(); i++) { if (isalpha(s[i])) s[i] = tolower(s[i]); else s[i] = ' '; } stringstream ss(s); while (ss >> s) { st.insert(s); } } set <string>::iterator it; for (it = st.begin();it!=st.end();it++) { cout << *it << "\n"; } return 0; }
文章標籤
全站熱搜
留言列表