-
Notifications
You must be signed in to change notification settings - Fork 0
/
10815.cpp
57 lines (48 loc) · 1.09 KB
/
10815.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "bits/stdc++.h"
using namespace std;
string give (string & str) {
string ret = "";
for (int i = 0; i < str.size(); i++) {
if ((str[i] <= 90 && str[i] >= 65) || (str[i] <= 122 && str[i] >= 97)){
if (str[i] <= 90 && str[i] >= 65) {
str[i]+= 32;
}
ret+=str[i];
}
}
return ret;
}
vector <string> foo (string & str) {
vector<string> vec;
string temp = "";
for (int i = 0; i < str.size(); i++) {
if ((str[i] <= 90 && str[i] >= 65) || (str[i] <= 122 && str[i] >= 97)) {
temp += str[i];
} else {
vec.push_back(temp);
temp = "";
}
}
vec.push_back(temp);
return vec;
}
int main () {
string in;
set<string> dict;
set<string>::iterator it;
while (getline(cin,in)) {
vector<string> vec = foo(in);
for (int i = 0; i < vec.size(); i++) {
string temp = vec[i];
string newStr = give(vec[i]);
dict.insert(newStr);
}
//string newStr = give(in);
//dict.insert(newStr);
}
for (it = dict.begin(); it != dict.end(); ++it) {
if (*it != "") {
cout << *it << endl;
}
}
}