#C12616. Word Length Calculator

    ID: 42063 Type: Default 1000ms 256MiB

Word Length Calculator

Word Length Calculator

Given a sentence consisting of words separated by whitespace, your task is to calculate the length of each word and output the lengths in order. Words are defined as sequences of non-space characters. Note that the input may contain leading or trailing spaces, and multiple spaces are treated as a single delimiter.

Mathematically, if the sentence is represented as SS, and the words are w1,w2,,wnw_1, w_2, \dots, w_n, then you need to compute result=[w1,w2,,wn]\text{result} = [|w_1|, |w_2|, \dots, |w_n|], where wi|w_i| denotes the number of characters in wiw_i. If the sentence is empty or contains no words, output an empty result.

inputFormat

Input is provided on standard input as a single line containing the sentence. The sentence may contain leading or trailing spaces.

outputFormat

Output the lengths of each word separated by a single space on one line. If there are no words, output an empty line.## sample

hello
5