文件名称:Sort Poems.cpp
文件大小:6KB
文件格式:CPP
更新时间:2013-05-02 13:01:51
数据结构 project2 源代码
数据结构基础课程project2——Sort Poems Harry once found an interesting ancient poem written on a long strip of paper. He decided to save this piece of art into his computer by scanning the paper segment by segment. However, over excited as he was, he forgot to name the segment files in the proper order! Harry almost fainted with hundreds of unsorted segment files in hand. Now he comes to you for help. The only clue he has is that there is always a one-line overlap between two consecutive segments. For example, the poem shown in Figure 1 is saved in two files as shown in Figure 2, provided that each file can only contain up to 4 lines. Notice that a blank line is also counted as a line in the second piece of file.