Skip to content

Commit 35000ec

Browse files
committed
[BOJ] #29701. 모스부호 / 브론즈2 / 9분 / 성공
1 parent 289f1e5 commit 35000ec

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import sys
2+
input = sys.stdin.readline
3+
4+
mos = {'.-':'A', '-...': 'B', '-.-.':'C', '-..':'D', '.':'E', '..-.':'F', '--.':'G', '....':'H',
5+
'..':'I', '.---':'J', '-.-':'K', '.-..':'L', '--':'M', '-.':'N', '---':'O', '.--.':'P',
6+
'--.-': 'Q', '.-.': 'R', '...':'S', '-':'T', '..-':'U', '...-':'V', '.--':'W', '-..-': 'X',
7+
'-.--':'Y', '--..':'Z', '.----':'1', '..---':'2', '...--':'3', '....-':'4', '.....':'5',
8+
'-....':'6', '--...':'7', '---..':'8', '----.':'9', '-----':'0', '--..--':',', '.-.-.-':'.',
9+
'..--..':'?', '---...':':', '-....-':'-', '.--.-.':'@'
10+
}
11+
n = int(input()) # 길이
12+
signal = input().strip().split()
13+
message = ''
14+
for sign in signal:
15+
message += mos[sign]
16+
print(message)

0 commit comments

Comments
 (0)