#K82032. Acronym Generator
Acronym Generator
Acronym Generator
Given an input string, generate an acronym by taking the first letter of each word in the string and converting it to uppercase. For example, if the input is Portable Network Graphics
, the output should be PNG
.
Formally, if the input string is (S) and (w_i) represents the i-th word in (S), then the acronym is computed as
[
\text{acronym} = \text{Upper}(w_1[0]),\text{Upper}(w_2[0]),\cdots,\text{Upper}(w_n[0])
]
where each word is derived by splitting (S) using whitespace as the delimiter.
inputFormat
The input is provided via standard input as a single line containing a string (S). The string may contain extra spaces and punctuation.
outputFormat
Output the acronym generated by concatenating the uppercase first letter of each word, printed on standard output.## sample
Portable Network Graphics
PNG