#C65. Capitalize the Words

    ID: 50266 Type: Default 1000ms 256MiB

Capitalize the Words

Capitalize the Words

Given a sentence, write a program to transform it into a new sentence where the first character of each word is capitalized and the rest of the word is in lowercase. The program should ignore any extra leading or trailing whitespace. Only alphabetic characters will be modified for capitalization; any non-alphabetic characters remain unchanged in their original positions.

For example:

  • hello world becomes Hello World
  • python IS fun! becomes Python Is Fun!
  • 4th of JULY becomes 4th Of July
  • javaSCRIPT is aweSOME becomes Javascript Is Awesome

Your solution must read input from stdin and print the result to stdout.

inputFormat

The input consists of a single line: a sentence which may contain spaces, letters, digits, and punctuation. Leading and trailing spaces should be ignored.

outputFormat

Output a single line containing the transformed sentence where each word is capitalized as described.

## sample
hello world
Hello World