看懂题意就没有什么好说的,water
#include <cstdio>
#include <cctype>
#include <set>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define MAX_CHAR 201
set<string> s;
char tmp[MAX_CHAR];
void deal(char *str)
{
int pos(0);
string t_str;
while( pos < strlen(str) ) {
t_str.clear();
while( isupper(str[pos]) || islower(str[pos]) ) {
t_str += (isupper(str[pos]))? str[pos]+32 : str[pos]; pos ++;
}
pos ++;
if( t_str.length() ) {
s.insert(t_str);
}
}
}
int main(int argc, char const *argv[])
{
#ifndef ONLINE_JUDGE
freopen("test.in", "r", stdin);
#endif
while( ~scanf("%s", tmp) ) {
deal(tmp);
}
for(set<string>::iterator it = s.begin(); it != s.end(); it ++) {
cout<<*it<<endl;
}
return 0;
}
uva_10815_Andy's First Dictionary
最新推荐文章于 2019-08-05 19:49:55 发布