
방법1
a, b = input().rstrip().split()
print(int(a, int(b)))
방법2
N,B = map(str,input().split())
num = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = 0
N = list(N)
N.reverse()
for i in range(len(N)):
ans += (int(B) ** i) * num.index(N[i])
print(ans)
| [파이썬/python] 백준 2720번 : 세탁소 사장 동혁(🥉3) (0) | 2023.04.03 |
|---|---|
| [파이썬/python] 프로그래머스 : 점프와 순간 이동 (Lv.2) (0) | 2023.03.31 |
| [파이썬/python] 백준 11005번 : 진법 변환 2 (🥉1) (0) | 2023.03.30 |
| [파이썬/python] 백준 4948번 : 베르트랑 공준 (🥈2) (에라토스테네스의 체) (0) | 2023.03.30 |
| [파이썬/python] 백준 11719번 : 그대로 출력하기 2 (🥉3) (0) | 2023.03.29 |