#include<bits/stdc++.h> using namespace std; int main() { set<string> ss; char line[205]; while (gets(line)) { int l=strlen(line); for (int i=0;i<l;i++) { if (line[i]>='A' && line[i]<='Z') line[i]+=32; } for (int i=0;i<l;i++) { int j=0; string s=""; while (j<l && line[i]>='a' && line[i]<='z') { s+=line[i]; i++; j=1; } if (j) { ss.insert(s); i--; } } } set<string> :: iterator it; for (it=ss.begin();it!=ss.end();it++) cout<<*it<<endl; return 0; }
Sunday, June 26, 2016
UVA 10815 Solution
Unknown
Studying at Shahjalal University of Science and Technology, Sylhet.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment