[백준/python] 11005 진법변환2

joseon0thing·2023년 8월 11일
0

python

목록 보기
11/17
post-thumbnail


최종 코드

arr = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
s = ''

while(True):
  a, base = map(int, input().split())

  if base < 2 or base > 36:
    print('재입력')
    continue
  else:
    while a:
      s += str(arr[a%base])
      a //= base
    
    print(s[::-1], end='')
    break

profile
정리.velog

0개의 댓글