#K95322. Capitalize Words in a Document
Capitalize Words in a Document
Capitalize Words in a Document
Given a document as a string, your task is to capitalize the first letter of each word. A word is defined as a contiguous sequence of alphabetical characters. The words can be separated by any non-alphabetical character such as punctuation marks or spaces.
For instance, if the input string is:
$$\texttt{hello,world!this.is?a:test;}$$the expected output is:
$$\texttt{Hello,World!This.Is?A:Test;}$$Process the string character by character and ensure that every word’s initial letter is capitalized while preserving all other characters.
inputFormat
The input consists of a single line containing a string. The string may include letters, punctuation marks, and spaces.
outputFormat
Output the modified string after capitalizing the first letter of each word. The output should be printed in a single line.
## samplehello,world!this.is?a:test;
Hello,World!This.Is?A:Test;