#K70492. Capitalize Sentences
Capitalize Sentences
Capitalize Sentences
Given a paragraph of text, you are required to capitalize the first letter of each sentence. A sentence is defined as a sequence of characters ending with one of the punctuation marks: period (.), exclamation mark (!), or question mark (?). The text may contain multiple spaces, and if there is no punctuation, the first letter of the text should be capitalized.
You must read the input from standard input (stdin) and write the output to standard output (stdout).
For example, given the input:
hello. how are you? i am fine!
The expected output is:
Hello. How are you? I am fine!
inputFormat
The input consists of a single line containing the paragraph text.
Note: The input can be an empty string.
outputFormat
The output should be a single line — the paragraph after capitalizing the first letter of every sentence.
## samplehello. how are you? i am fine!
Hello. How are you? I am fine!