반응형
https://www.acmicpc.net/problem/1550
# @Author YoungMinKim
# baekjoon
N=list(input())
dic = {'A':10,'B':11,'C':12,'D':13,'E':14,'F':15}
idx=0
result=0
for i in N:
if i in dic.keys():
result+=dic[i]*(16**(len(N)-1-idx))
else:
result+=int(i)*(16**(len(N)-1-idx))
idx+=1
print(result)
반응형
'백준 문제풀이' 카테고리의 다른 글
baekjoon - python - 1924 (0) | 2020.08.21 |
---|---|
baekjoon - python - 1712 (0) | 2020.08.21 |
baekjoon - python - 1546 (0) | 2020.08.21 |
baekjoon - python - 1417 (0) | 2020.08.21 |
baekjoon - python - 1373 (0) | 2020.08.21 |
댓글