#C14075. Word Lengths
Word Lengths
Word Lengths
Given a string S, your task is to compute a list of integers where each integer represents the length of a word in the string after removing all punctuation. Words are defined as sequences of characters separated by one or more spaces. Specifically, punctuation (as defined by the standard ASCII punctuation characters) should be removed from the string before splitting it into words.
For example, if S is "Hello, world!", after removing punctuation the string becomes "Hello world", and the resulting word lengths are 5 5
.
You should read the input from standard input (stdin
) and print your result to standard output (stdout
). The output should list the lengths of the words separated by a single space.
inputFormat
The input consists of a single line containing the string S. The string may include punctuation, multiple spaces, and will always be provided as valid text.
outputFormat
Output a sequence of integers separated by a single space, each corresponding to the length of a word from the input string after removing punctuation.
## sampleHello world
5 5