一道简单编程,可用c++/java,望帮助

题目内容如下

img

img

示例输入如下:
Peter's Adventures in Disneyland
Two blondes were going to Disneyland when they came to a fork in the road. The sign read: "Disneyland Left."
So they went home.

示例输出如下:
disneyland
in
the
they
to
a
adventures
blondes
came
fork
going
home
left
peter
read
road
sign
so
two
went
were
when

希望帮助解决!