-
Notifications
You must be signed in to change notification settings - Fork 0
/
prob_11062.cpp
55 lines (53 loc) · 1.21 KB
/
prob_11062.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
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <map>
#include <cstring>
#include <vector>
#include <stack>
#include <queue>
#include <stdlib.h>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <climits>
#include <list>
#include <set>
#include <forward_list>
#define rep(i,a,b) for(i=a;i<b;++i)
#define vectIter(vect) for(auto &val: vect)
#define mapIter(map_) for(auto &val_: map_)
#define gc getchar_unlocked
#define si(n) scanf("%d",&n)
#define sii(m,n) scanf("%d%d",&m,&n)
#define ssi(str,a) scanf("%s%d",str,&a)
#define sis(a,str) scanf("%d%s",&a,str)
#define ss(str) scanf("%s",str)
using namespace std;
#define INF 999999999
char convert(char ch){
if(ch=='-') return '-';
else if(isalpha(ch)) return tolower(ch);
else return ' ';
}
int main(){
int i,j,k;
string str;
set<string> dict;
while(getline(cin,str)){
string str2="";
while(str[str.size()-1]=='-'){
str.erase(str.size()-1);
transform(str.begin(),str.end(),str.begin(),convert);
str2+=str;
getline(cin,str);
}
transform(str.begin(),str.end(),str.begin(),convert);
str2+=str;
stringstream stream(str2);
while(stream >> str)
dict.insert(str);
}
vectIter(dict) cout << val <<endl;
}