fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5.  
  6.  
  7. set<string> dict;
  8. set<string>::iterator it;
  9. int main()
  10. {
  11.  
  12.  
  13. string s;
  14. cin>>s;
  15.  
  16. string tmp;
  17. bool last=0;
  18. while(cin>>s)
  19. {
  20.  
  21.  
  22. for(int i=0;i<s.size();i++)
  23. {
  24. if(isalpha(s[i]) || last) tmp+=tolower(s[i]);
  25. else if(s[i]=='-' && i==s.size()-1) {last=1;continue;}
  26. else
  27. {
  28. if(s[i]=='-' && i<s.size()-1) tmp+=s[i];
  29. else
  30. {
  31. dict.insert(tmp);
  32. tmp="";
  33. }
  34. }
  35. last=0;
  36. }
  37.  
  38. if(last) continue;
  39. else
  40. {
  41. dict.insert(tmp);
  42. tmp="";
  43. }
  44.  
  45. }
  46.  
  47. for(it=dict.begin();it!=dict.end();it++) cout<<*it<<'\n';
  48.  
  49.  
  50.  
  51. }
Success #stdin #stdout 0s 4332KB
stdin
Adv-
ent-
ures
in
Dis-
ney-
land

Two blondes were go-
ing to Disney-land
when they came to a
fork in the road.
The sign read: "Dis-
neyland Left."

So they went home.

This is takin' so so so, lo-
ng!!!!!!!!
Why??????


What is t-
hat little-guy!!!

will-lima@pop.com.br

pe-
er-2-peer!!

I have a 22 years oLd GUY insIde me at tHIs moment!!!

Andy is now 9-
year old and is getting ambitious.

Sub-
concious mind. Dre-
am-Theater-Scenes!

tes-
-1
stdout
-peer
a
ambitious
and
andy
at
blondes
br
came
com
disney-land
disneyland
dream-theater-scenes
entures
fork
getting
going
guy
have
home
i
in
inside
is
left
little-guy
long
me
mind
moment
now
old
peer-
pop
read
road
sign
so
subconcious
takin
tes-
that
the
they
this
to
two
went
were
what
when
why
will-lima
year
years