File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # [ Bronze IV] 알파벳 개수 - 10808
2+
3+ [ 문제 링크] ( https://www.acmicpc.net/problem/10808 )
4+
5+ ### 성능 요약
6+
7+ 메모리: 9352 KB, 시간: 104 ms
8+
9+ ### 분류
10+
11+ 구현, 문자열
12+
13+ ### 제출 일자
14+
15+ 2026년 2월 3일 19:35:37
16+
17+ ### 문제 설명
18+
19+ <p >알파벳 소문자로만 이루어진 단어 S가 주어진다. 각 알파벳이 단어에 몇 개가 포함되어 있는지 구하는 프로그램을 작성하시오.</p >
20+
21+ ### 입력
22+
23+ <p >첫째 줄에 단어 S가 주어진다. 단어의 길이는 100을 넘지 않으며, 알파벳 소문자로만 이루어져 있다.</p >
24+
25+ ### 출력
26+
27+ <p >단어에 포함되어 있는 a의 개수, b의 개수, …, z의 개수를 공백으로 구분해서 출력한다.</p >
28+
Original file line number Diff line number Diff line change 1+ // /dev/stdin
2+ const fs = require ( "fs" ) ;
3+ let input = fs . readFileSync ( "/dev/stdin" ) . toString ( ) . trim ( ) . split ( "\n" ) ;
4+
5+ const word = input [ 0 ] ;
6+
7+ const alpha = {
8+ a : 0 ,
9+ b : 0 ,
10+ c : 0 ,
11+ d : 0 ,
12+ e : 0 ,
13+ f : 0 ,
14+ g : 0 ,
15+ h : 0 ,
16+ i : 0 ,
17+ j : 0 ,
18+ k : 0 ,
19+ l : 0 ,
20+ m : 0 ,
21+ n : 0 ,
22+ o : 0 ,
23+ p : 0 ,
24+ q : 0 ,
25+ r : 0 ,
26+ s : 0 ,
27+ t : 0 ,
28+ u : 0 ,
29+ v : 0 ,
30+ w : 0 ,
31+ x : 0 ,
32+ y : 0 ,
33+ z : 0 ,
34+ } ;
35+
36+ for ( let i = 0 ; i < word . length ; i ++ ) {
37+ alpha [ word [ i ] ] ++ ;
38+ }
39+
40+ console . log ( Object . values ( alpha ) . join ( " " ) ) ;
You can’t perform that action at this time.
0 commit comments