백준 11005번: 진법 변환 2 #Python

ColorlessDia·2025년 1월 11일

algorithm/baekjoon

목록 보기
419/815
N, B = map(int, input().split())

V = ord('A') - 10
R = ''

while 0 < N:
    r = N % B

    R += str(chr(r + V)) if 10 <= r else str(r)
    N //= B

result = R[::-1]

print(result)

0개의 댓글