#K46017. Word Lengths Calculation
Word Lengths Calculation
Word Lengths Calculation
Given a single line of text consisting of words separated by spaces, your task is to determine the length of each word and print these lengths in the order they appear. Formally, for each word \(w\), its length is \(|w|\). Note that the input may contain extra spaces between words or at the beginning or end of the line. If the input string is empty or contains only whitespace, print nothing.
inputFormat
The input consists of a single line which is a string. The string may contain multiple spaces between words as well as leading or trailing spaces.
outputFormat
Print the lengths of each word in the given string in the order they appear, separated by a single space. If there are no words, print nothing.
## sampleHello world this is a test
5 5 4 2 1 4