fork download
  1. #include <iostream>
  2. #include <fstream>
  3. #include <iterator>
  4. #include <list>
  5. #include <string>
  6. #include <algorithm>
  7. using namespace std;
  8.  
  9. // takes the file being processed as only command line param
  10. int main(int argc, char *argv[])
  11. {
  12. istream_iterator<string> inf_it(cin), inf_eof;
  13. list<string> mylist(inf_it, inf_eof);
  14. mylist.sort();
  15. copy(mylist.begin(), mylist.end(), ostream_iterator<string>(cout,"\n"));
  16.  
  17. return EXIT_SUCCESS;
  18. }
Success #stdin #stdout 0s 2992KB
stdin
All the world's a stage,
And all the men and women merely players:
They have their exits and their entrances;
And one man in his time plays many parts,
His acts being seven ages. At first, the infant,
Mewling and puking in the nurse's arms.
And then the whining school-boy, with his satchel
And shining morning face, creeping like snail
Unwillingly to school. And then the lover,
Sighing like furnace, with a woeful ballad
Made to his mistress' eyebrow. Then a soldier,
Full of strange oaths and bearded like the pard,
Jealous in honour, sudden and quick in quarrel,
Seeking the bubble reputation
Even in the cannon's mouth. And then the justice,
In fair round belly with good capon lined,
With eyes severe and beard of formal cut,
Full of wise saws and modern instances;
And so he plays his part. The sixth age shifts
Into the lean and slipper'd pantaloon,
With spectacles on nose and pouch on side,
His youthful hose, well saved, a world too wide
For his shrunk shank; and his big manly voice,
Turning again toward childish treble, pipes
And whistles in his sound. Last scene of all,
That ends this strange eventful history,
Is second childishness and mere oblivion,
Sans teeth, sans eyes, sans taste, sans everything.
stdout
All
And
And
And
And
And
And
And
And
At
Even
For
Full
Full
His
His
In
Into
Is
Jealous
Last
Made
Mewling
Sans
Seeking
Sighing
That
The
Then
They
Turning
Unwillingly
With
With
a
a
a
a
acts
again
age
ages.
all
all,
and
and
and
and
and
and
and
and
and
and
and
arms.
ballad
beard
bearded
being
belly
big
bubble
cannon's
capon
childish
childishness
creeping
cut,
ends
entrances;
eventful
everything.
exits
eyebrow.
eyes
eyes,
face,
fair
first,
formal
furnace,
good
have
he
his
his
his
his
his
his
his
history,
honour,
hose,
in
in
in
in
in
in
infant,
instances;
justice,
lean
like
like
like
lined,
lover,
man
manly
many
men
mere
merely
mistress'
modern
morning
mouth.
nose
nurse's
oaths
oblivion,
of
of
of
of
on
on
one
pantaloon,
pard,
part.
parts,
pipes
players:
plays
plays
pouch
puking
quarrel,
quick
reputation
round
sans
sans
sans
satchel
saved,
saws
scene
school-boy,
school.
second
seven
severe
shank;
shifts
shining
shrunk
side,
sixth
slipper'd
snail
so
soldier,
sound.
spectacles
stage,
strange
strange
sudden
taste,
teeth,
the
the
the
the
the
the
the
the
the
the
the
their
their
then
then
then
this
time
to
to
too
toward
treble,
voice,
well
whining
whistles
wide
wise
with
with
with
woeful
women
world
world's
youthful