论文部分内容阅读
表演这个魔术时,如果用其他计算器,例如手机上的计算器,就很可能不成功了。不信的话,你可以试一试。上面魔术中,观众运算的式子是:(abcd×80+1)×250+efgh+efgh。这个数字减去250,再除以2,当然就是abcdefgh。那为什么手机上的计算器不能这样操作呢?原来,我们手机上的计算器是算术计算器,而上面这个魔术用的是财务计算器。财务计算器使用了一种称作“堆栈”的数据结构,你不需要按等号,计算器就会将当前运算结果直接
When performing this trick, it may well be unsuccessful if you use another calculator, such as a calculator on your phone. If you do not believe it, you can give it a try. In the above magic, the formula of the audience operation is: (abcd × 80 + 1) × 250 + efgh + efgh. This number minus 250, divided by 2, of course, is abcdefgh. So why the calculator on the phone can not do this? It turned out that the calculator on our cell phone is an arithmetic calculator, and the magic above is the financial calculator. Financial Calculator uses a data structure called “stack ”, you do not need to press the equal sign, the calculator will be the results of the current operation directly