题解 | #数制转换#
数制转换
https://www.nowcoder.com/practice/8ef02ef8571b417d8c311a87861f7a03
def fun(a):
if a < 10:
return str(a)
elif a >= 10:
return chr(65 + a - 10)
def tentoany(a, b):
res = ''
while a:
res = fun(a%b) + res
a = a // b
return res
while True:
try:
s = input().split()
n = int(s[1], int(s[0]))
res = tentoany(n, int(s[2]))
print(res)
except:
break
正浩创新EcoFlow公司福利 707人发布