Word wrap X84237


Statement
 

pdf   zip

html

Input Input will be a number to specify the column width of resulting output lines, followed by the long text in several lines ending with the symbol ‘#’.

Output The result of the wrapped text.

Public test cases
  • Input

    20
    It takes a big man to cry, but it takes a bigger man to laugh at that man.
    When you're riding in a time machine way far into the future, don't stick your elbow out the window, or it'll turn into a fossil.
    I wish I had a Kryptonite cross, because then you could keep both Dracula AND Superman away.
    I don't think I'm alone when I say I'd like to see more and more planets fall under the ruthless domination of our solar system.
    I hope if dogs ever take over the world, and they chose a king, they don't just go by size, because I bet there are some Chihuahuas with some good ideas.
    The face of a child can say it all, especially the mouth part of the face.#
    

    Output

    It takes a big man
    to cry, but it
    takes a bigger man
    to laugh at that
    man.
    When you're riding
    in a time machine
    way far into the
    future, don't stick
    your elbow out the
    window, or it'll
    turn into a fossil.
    I wish I had a
    Kryptonite cross,
    because then you
    could keep both
    Dracula AND
    Superman away.
    I don't think I'm
    alone when I say
    I'd like to see
    more and more
    planets fall under
    the ruthless
    domination of our
    solar system.
    I hope if dogs ever
    take over the
    world, and they
    chose a king, they
    don't just go by
    size, because I bet
    there are some
    Chihuahuas with
    some good ideas.
    The face of a child
    can say it all,
    especially the
    mouth part of the
    face.
    
  • Information
    Author
    HP CodeWars
    Language
    English
    Official solutions
    Python
    User solutions
    C++ Python