算法来转换在未知基站的一些为等效的十进制数 [英] algorithm to convert a number in an unknown base to the equivalent base 10 number
本文介绍了算法来转换在未知基站的一些为等效的十进制数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
<一href="http://stackoverflow.com/questions/3545931/efficient-algorithm-for-conversion-between-numeral-system">Efficient算法的数字系统之间的转换
Possible Duplicate:
Efficient algorithm for conversion between numeral system
给定一个整数,写一个程序,给定的数字转换为数字(基数为10)。提示 - 在给定数量可以是任何基础,但基础是未知的。
Given an integer, write a program that converts the given number to a number (in base 10). Hint - The given number could be in any base, but the base is unknown.
推荐答案
这是无法做到的;不知道的源代码库的数量是不明确的。 10
在基地 N
转化为 N
在基地 10
;有无限的可能性。
That can't be done; without knowing the source base the number is ambiguous. 10
in base n
translates to n
in base 10
; there are infinite possibilities
这篇关于算法来转换在未知基站的一些为等效的十进制数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文