• 2009-03-02

    你会让我们自卑的||| - [B.T]

    版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
    http://yesilver.blogbuss.com/logs/35961161.html

    String concatenation
    Write a program that will accept two strings (1 <= length <= 50) and output the sequence of the first string converting to the second string, such that each conversion only add/modify/delete one character. In case more than one such conversion sequence is possible, print the one sequence that contains the shortest steps.

    Input specification:
    Two strings separated by space on a single line.

    Output Specification:
    The sequence of conversion steps, each in a separate line.

    Examples:

    Input:
    abcd afgd

    Output:
    abcd
    afcd
    afgd

    Input:
    efgh cdef

    Output:
    efgh
    efg
    ef
    def
    cdef

    Input:
    abcdefg bdf

    Output:
    abcdefg
    bcdefg
    bdefg
    bdfg
    bdf

     

    {今晚十二点前}

    听起来像一个赌注。


    随机文章:

    puppy love 2009-02-25
    Oh,origin。 2009-02-23
    Restart . 简单 2009-02-22

    收藏到:Del.icio.us