Topic Connection: http://acm.hust.edu.cn/vjudge/problem/18649
Sample Input
Adventures in Disneyland
Blondes were going to Disneyland, they came to a fork in the
Road.
The sign read: "Disneyland left." So they went home. Sample Output
A
Adventures
Blondes
Came
Disneyland
Fork
Going
Home
Inch
Left
Read
Road
Sign
So
The
They
To
Both
Went
Were
When test instructions
is to follow the dictionary order to output each word, regardless of the case, all converted to lowercase output. Solving
The place of a slight pit, for example: "Ffw.sef", this is counted as two words ffw and SEF. StringStream SS Stream Processing method (new posture) See Code StringStream SS (s), you can process the string s separately into each word Code
#include <bits/stdc++.h> using namespace std; void tr (string &st) {String::iterator
A
For (A=st.begin (); A!=st.end (); a++) {if (*a>= ' a ' &&*a<= ' Z ') *a=*a+32;
else if (*a>= ' a ' &&*a<= ' z ') *a=*a;
else {*a= ';}
}} int main () {set<string> s;
String Zz,buf;
while (CIN>>ZZ) {tr (ZZ);
StringStream SS (ZZ);
while (SS>>BUF) S.insert (BUF);
} Set<string>::iterator it;
For (It=s.begin (); It!=s.end (); it++) {cout<<*it<< "\ n";
} return 0; }