进制转换: n=int(input('请输入数字')) jz=int(input('几进制')) s=" " while n>0: t=n%jz s=str(t)+s n=n//jz print(s) 结果: