TopCoder

User's AC Ratio

100.0% (1/1)

Submission's AC Ratio

100.0% (1/1)

Tags

Description

有個莫名其妙的國家,他們存了許多的英文文章檔案在中央電腦系統內。某天,一位工程師發現這些檔案都被病毒入侵了。不幸中的大幸是這些文章只有大小寫被病毒修改了。

請你寫個程式幫忙復原這些英文檔案,使大小寫符合英文文法:句首單字開頭大寫,其餘單字皆為小寫,每句話皆為句點結尾。已知這些檔案內皆沒有專有名詞,不存在非句首卻大寫的情形。

Input Format

輸入只有一行長度為 $L(1\le L \le 1000)$ 的字串,包含大小寫的英文字元、標點符號 ,. 以及空格。

Output Format

輸出一行長度亦為 $L$ 的字串,符合英文文法大小寫規則。

Sample Input 1

i lIkE WritING CodE. I hAte bUgs.

Sample Output 1

I like writing code. I hate bugs.

Sample Input 2

aN apPLe a dAy kEEpS THE dOcTER AwAy.

Sample Output 2

An apple a day keeps the docter away.

Hints

Problem Source

Subtasks

No. Testdata Range Constraints Score
1 0~1 範例測資 0
2 0~8 無額外限制 100

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 524288 65536 1 2
1 1000 524288 65536 1 2
2 1000 524288 65536 2
3 1000 524288 65536 2
4 1000 524288 65536 2
5 1000 524288 65536 2
6 1000 524288 65536 2
7 1000 524288 65536 2
8 1000 524288 65536 2