프로그래밍/Baekjoon

(파이썬) 백준 알고리즘 5622번 다이얼

J_Remind 2019. 4. 1. 22:30

문제

풀이 (Python)

1
2
3
4
5
6
7
8
dial = ['ABC', 'DEF', 'GHI', 'JKL', 'MNO', 'PQRS', 'TUV', 'WXYZ']
a = input()
ret = 0
for j in range(len(a)):
    for i in dial:
        if a[j] in i:
            ret += dial.index(i)+3
print(ret)
Colored by Color Scripter
cs

문제 출처

https://www.acmicpc.net/problem/5622


저작자표시 (새창열림)