#C22. Capitalize Each Word
Capitalize Each Word
Capitalize Each Word
You are given a sentence, i.e., a string consisting of words separated by spaces. Your task is to transform the sentence so that each word starts with an uppercase letter and the remaining letters are in lowercase. For example, if the input is hello world THIS is A tEsT
, the output should be Hello World This Is A Test
.
The transformation should be applied to each word independently. The input will contain only English alphabets and spaces.
inputFormat
The input consists of a single line containing the sentence. Words are separated by one or more spaces.
outputFormat
Output the transformed sentence where every word's first letter is uppercase and the rest are lowercase.
## samplehello world this is a test
Hello World This Is A Test