#C11629. Calculate Word Lengths

    ID: 40966 Type: Default 1000ms 256MiB

Calculate Word Lengths

Calculate Word Lengths

Given a string, your task is to compute the length of each word and output the results. A word is defined as a maximal sequence of non-space characters. In mathematical terms, if the string is split by spaces, the length of each word (w_i) is given by (\lvert w_i \rvert). If the input is empty or exactly "None", output an empty line.

inputFormat

The input consists of a single line string which may contain leading or trailing spaces. The string might be empty or the literal "None".

outputFormat

Print the lengths of each word separated by a single space. If there are no words, print an empty line.## sample

Hello world
5 5