본문으로 건너뛰기

BOJ 10808

10808 알파벳 개수

Clicking the heading will take you to the BOJ problem.

Solution

join(), ord()를 사용했다. print(*count)로 리스트 요소들을 모두 출력하는 방법도 있다.

word = input()
count = [0] * 26

for c in word:
    count[ord(c) - ord('a')] += 1

print(' '.join(map(str, count))) # print(*count)