题解 | #进制间转换#
进制间转换
https://www.nowcoder.com/practice/f6bca30942874d01863ccfd44ae260f0
def convert(num,bit): if num == 0: return 0 temp = [] while(num//bit>=bit): temp.append(num%bit) num = num//bit temp.append(num%bit) temp.append(num//bit) res = ''.join([str(x) for x in temp[::-1]]) return res a,b = [int(x) for x in input().split()] print(convert(a,b))