n = 0
p = input('input a octal number:')
for i in range(len(p)):
n = n * 8 + ord(p[i]) - ord('0')
print(n)
八进制转换为十进制
最新推荐文章于 2023-10-05 07:54:00 发布
n = 0
p = input('input a octal number:')
for i in range(len(p)):
n = n * 8 + ord(p[i]) - ord('0')
print(n)