꾸준히 합시다
백준 파이썬 11784번: Hex Code 본문
https://www.acmicpc.net/problem/11784
11784번: Hex Code
In the movie The Martian (2015), astronaut Mark Watney, one of the crew members of Mission Ares III, was left behind on Mars due to an unexpected incident during the surface exploration on the planet Mars. The communication with Earth was quasi-inexistent.
www.acmicpc.net
문제 유형: 구현
# Solution 1
while True:
try:
s = input()
print(bytearray.fromhex(s).decode())
except EOFError:
break
try, except를 사용해 예외처리를 해주지 않으면 런타임 에러 (EOFError)가 발생해 테스트를 통과하지 못하게 된다.
'코딩 테스트 문제 풀이' 카테고리의 다른 글
백준 파이썬 2501번: 약수 구하기 (0) | 2021.07.11 |
---|---|
백준 파이썬 5101번: Sequences (0) | 2021.07.10 |
백준 파이썬 16360번: Go Latin (0) | 2021.06.15 |
백준 파이썬 13288번: A New Alphabet (0) | 2021.06.14 |
백준 파이썬 16337번: Die (0) | 2021.06.13 |
Comments