python代码实现
思路: 整数除n取余,倒序即得五进制
def func(num):
if num == 0:
return '0'
result = ''
while num > 0:
mode = num % 5
res = result + str(mode)
num //= 5
return res[::-1]
python代码实现
思路: 整数除n取余,倒序即得五进制
def func(num):
if num == 0:
return '0'
result = ''
while num > 0:
mode = num % 5
res = result + str(mode)
num //= 5
return res[::-1]