#C134. Substitute String Lengths
Substitute String Lengths
Substitute String Lengths
You are given a list of strings. For each string, if its length is strictly greater than 5, replace it with its length; otherwise, keep the string unchanged. Your program should process the input provided via standard input and produce output to standard output.
For example, given the list ["hello", "beautiful", "world"]
, the output should be:
hello 9 world
Note: The strings are read one by one following an integer that represents the total number of strings.
inputFormat
The first line of input contains an integer n representing the number of strings. The following n lines each contain a single string.
outputFormat
Output exactly n lines. For each string, if its length is greater than 5, output its length (an integer); otherwise, output the string itself.
## sample3
hello
beautiful
world
hello
9
world
</p>