Programming/Python & Data Structures
[Baekjoon/Python3] 5622번 다이얼
HooNeee
2020. 12. 5. 21:44
[Baekjoon/Python3] 5622번 다이얼
5622번: 다이얼
첫째 줄에 알파벳 대문자로 이루어진 단어가 주어진다. 단어는 2글자~15글자로 이루어져 있다.
www.acmicpc.net
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)