Back to home page
  • Reverse words

    Challenge Description:

    Write a program which reverses the words in an input sentence.

    Input sample:

    The first argument is a file that contains multiple sentences, one per line. Empty lines are also possible.

    For example:

    Hello World Hello CodeEval

    Output sample:

    Print to stdout each sentence with the reversed words in it, one per line. Empty lines in the input should be ignored. Ensure that there are no trailing empty spaces in each line you print.

    For example:

    World Hello CodeEval Hello
Login to submit solution