#K91992. Capitalize Words in a String
Capitalize Words in a String
Capitalize Words in a String
You are given a string consisting of words separated by spaces. Your task is to transform the string so that for any word containing only alphabetical characters, the first letter is capitalized and the remaining letters are converted to lowercase. Words that include any non-alphabetical characters should remain unchanged.
For example:
- The word
hello
becomesHello
. - The word
WORLD
becomesWorld
. - The word
w0rld!
remainsw0rld!
because it contains non-alphabetical characters.
Note: The input is provided from standard input (stdin) and the output should be printed to standard output (stdout).
inputFormat
The input consists of a single line containing a string S where words are separated by spaces. The string may be empty.
outputFormat
Output a single line which is the transformed version of the input string according to the rules described.
## samplehello world
Hello World