관리 메뉴

꾸준히 합시다

백준 파이썬 13288번: A New Alphabet 본문

코딩 테스트 문제 풀이

백준 파이썬 13288번: A New Alphabet

tturbo0824 2021. 6. 14. 09:35

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

 

13288번: A New Alphabet

Input contains one line of text, terminated by a newline. The text may contain any characters in the ASCII range 32–126 (space through tilde), as well as 9 (tab). Only characters listed in the above table (A–Z, a–z) should be translated; any non-alph

www.acmicpc.net

문제 유형: 구현, 문자열

 

 

# Solution 1

alpha = [' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
symbol = [' ', '@', '8', '(', '|)', '3', '#', '6', '[-]', '|', '_|', '|<', '1', '[]\/[]', '[]\[]', '0', '|D', '(,)', '|Z', '$', "']['", '|_|', '\/', '\/\/', '}{', '`/', '2']

k = input().lower()

answer = ''

for character in k:
    if character in alpha:
        answer += symbol[alpha.index(character)]
    else:
        answer += character

print(answer)

 

Comments