文件名称:radix
介绍说明--下载内容均来自于网络,请自行研究使用
一位数学老师,经常写一些乘法算式,看起来是不对的,但经过进制转换却是正确的。比如5*8=34,如果是12进制的运算则是正确的。
你的目标是写出一个程序,找到正确的进制(介于2和16之间),如果找不到则输出0。注意,若有多种情况,则输出最小进制。如10*10=100,则输出2。
第一种:10*10=100输出10,不符合输出2的结果
先计算出两个数乘积的十进制数,再将此十进制数转换为2到16的进制数,依次与原先给出的结果值比较,若相等,则输出当前为几进制,若都不相等,则输出0-A math teacher, often write some multiplication facts, it appears to be wrong, but after binary conversion is correct. For example, 5* 8 = 34, if it is 12-ary calculation is correct. Your goal is to write a program to find the right hex (between 2 and 16), the output is 0 if not found. Note that if many cases, the minimum output hex. Such as 10* 10 = 100, output 2. The first is: 10* 10 = 100 outputs 10, does not comply with the output of 2 decimal first calculate the product of two numbers, and then convert this decimal to hexadecimal 2-16 sequentially given with the original The resulting value comparison, if the same, then the output current of a few decimal, if not equal, then output 0
你的目标是写出一个程序,找到正确的进制(介于2和16之间),如果找不到则输出0。注意,若有多种情况,则输出最小进制。如10*10=100,则输出2。
第一种:10*10=100输出10,不符合输出2的结果
先计算出两个数乘积的十进制数,再将此十进制数转换为2到16的进制数,依次与原先给出的结果值比较,若相等,则输出当前为几进制,若都不相等,则输出0-A math teacher, often write some multiplication facts, it appears to be wrong, but after binary conversion is correct. For example, 5* 8 = 34, if it is 12-ary calculation is correct. Your goal is to write a program to find the right hex (between 2 and 16), the output is 0 if not found. Note that if many cases, the minimum output hex. Such as 10* 10 = 100, output 2. The first is: 10* 10 = 100 outputs 10, does not comply with the output of 2 decimal first calculate the product of two numbers, and then convert this decimal to hexadecimal 2-16 sequentially given with the original The resulting value comparison, if the same, then the output current of a few decimal, if not equal, then output 0
(系统自动生成,下载前可以参看下载内容)
下载文件列表
进制问题.doc