• Home
  • About
    • JOOS photo

      JOOS

      Joos's blog

    • Learn More
    • Email
    • Github
  • Posts
    • All Posts
    • All Tags
  • Projects

[백준] 11005번 : 진법 변환 2 with python3

26 Sep 2018

Reading time ~1 minute

문제: https://www.acmicpc.net/problem/11005

import sys

read = lambda : sys.stdin.readline().strip()
n, b = map(int, read().split(' '))

ans = ''
while n >0:
    tmp = (n%b)
    n //= b

    if tmp >9:
        tmp = chr(tmp+55)
    ans += str(tmp)
print(ans[::-1])

… 대소문자를 생각해서 숫자를 더해야한다(…)



algorithm백준 Share Tweet +1