进制转换 - 中南大学 题解:Python
n = int(input())
for i in range(0,n):
m = int(input())
num = [0]*200
for j in range(0,200):
num[j] = 1
ii = 0
while True:
num[ii] = m % 8
m = (int)(m / 8)
ii = ii + 1
if m==0:
break
sum1 = 0
for jj in range(ii-1,-1,-1):
sum1 = sum1 + num[jj]*pow(10,jj)
print(sum1)
登录后发布评论
暂无评论,来抢沙发