Description
To prepare for the English exam Little Ho collected many digital reading materials. Unfortunately the materials are messed up by a malware.
It is known that the original text contains only English letters (a-zA-Z), spaces, commas, periods and newlines, conforming to the following format:
-
Each sentence contains at least one word, begins with a letter and ends with a period.
-
In a sentence the only capitalized letter is the first letter.
-
In a sentence the words are separated by a single space or a comma and a space.
-
The sentences are separated by a single space or a single newline.
It is also known the malware changes the text in the following ways:
-
Changing the cases of letters.
-
Adding spaces between words and punctuations.
Given the messed text, can you help Little Ho restore the original text?
Input
A string containing no more than 8192 English letters (a-zA-Z), spaces, commas, periods and newlines which is the messed text.
Output
The original text.
Sample Input
my Name is Little Hi.
His name IS Little ho , We are friends.
Sample Output
My name is little hi.
His name is little ho, we are friends.
2. Analysis
3. Solution(s)
|
|
近期评论