#C12616. Word Length Calculator
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 , and the words are , then you need to compute , where denotes the number of characters in . 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