Character Frequencies | 프로그래밍의 벗 PivotOJ
PivotOJ

Character Frequencies

시간 제한: 1000ms메모리 제한: 1024MB출처: EIO 2021-22 openBOJ 29847

문제

John is preparing a printing press for a publication. He needs to check that he has enough of type pieces---little blocks of cast metal with the shapes of characters on them. To help John, write a program to count the number of times each character appears in his text.

입력

The first line of input contains NN, the number of lines in John's publication (1N10001 \le N \le 1\,000). The following NN lines contain the text. Each line may consist of up to 100100 characters. The text may contain uppercase and lowercase letters, digits, and punctuation marks.

출력

Output the frequency table of the characters that appear in the input text. On each line, output one character and its frequency (the number of times it appears in the text), spearated by a space. The lines may be listed in any order. Do not count the spaces and line breaks as characters.

예제

예제 1

입력
4
A printing press is a mechanical device
for applying pressure to an inked surface
resting upon a print medium (such as paper
or cloth), thereby transferring the ink.
출력
( 1
) 1
, 1
. 1
A 1
a 10
b 1
c 6
d 3
e 15
f 3
g 4
h 5
i 12
k 2
l 3
m 3
n 12
o 5
p 9
r 14
s 10
t 8
u 5
v 1
y 2
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.