发一道题给大家做做!!
编写一个程序,从文件中一行一行的读取文本,并完成如下任务:如果文件中有两行或者是更多行相邻的文本内容相同,那么就打印出其中一行!你可以假定文件中的文本在长度上不会超过128个字符!!!
考虑下面对输入文件:
This is the first line.Another line.
And another.
And another.
And another.
And another.
Still more.
Almost done now --
Almost done now --
Another line.
Still more.
Finished!
输出的结果是:
This is the first line.Another line.
And another.
Still more.
Almost done now --
Another line.
Still more.
Finished!