#C102. Title Case Sentence
Title Case Sentence
Title Case Sentence
Given a sentence as a string, convert each word of the sentence so that the first character is in uppercase and the rest of the characters are in lowercase. The transformation should preserve the original spacing and punctuation.
For instance, if the input is "hello world", the output should be "Hello World". Note that if a word begins with a non-alphabetic character, it should remain unchanged, but the remaining alphabetic characters in the word should be converted to lowercase.
Input Format: The input is a single line containing the sentence.
Output Format: Output the title-cased sentence on a single line.
Examples:
- Input:
hello world
→ Output:Hello World
- Input:
JAVA is a FUN language.
→ Output:Java Is A Fun Language.
inputFormat
The input will be given via standard input (stdin) as a single line containing a sentence. The sentence may include letters, digits, spaces, and punctuation. Leading, trailing, and multiple consecutive spaces should be preserved.
outputFormat
The output should be written to standard output (stdout) and consist of the transformed sentence after converting each word into title case.
## samplehello world
Hello World