String Standardization

View as PDF

Submit solution

Points: 1.00
Time limit: 1.0s
Memory limit: 512M
Input: stdin
Output: stdout

Author:
Problem source:
HNOI TST Trường THPT Mỹ Đức A (2024 - 2025)
Problem types

Attempt

Please login to see your submissions result.


Last updated: on Dec. 16, 2024, 8:56 a.m.

Problem

Given a string ~S~ consisting only of letters and spaces, string standardization that:

  • There are no leading or trailing spaces.
  • There is no more than one space between words.
  • The first letter of each word is uppercase, and the rest are lowercase.

Input

Single line contain a string ~S~.

Output

String ~S~ after standardization.

Constraints

~1 \leq |S| \leq 1000~, with ~|S|~ is the length of ~S~.

Sample

Note: The sample and test cases will include trailing spaces.

Sample Input Sample Output
tHpT My duC A
Thpt My Duc A
gDSc PtiT
Gdsc Ptit

Comments

Please read the guidelines before commenting.


There are no comments at the moment.