一个很难的数学问题(智力140以下勿进) 旧版Java程序设计Page97 3.12题 庞涓拿到两个整数(2到99之间)之和,孙膑拿到两个整数之积。下面...
代码说明:
一个很难的数学问题(智力140以下勿进) 旧版Java程序设计Page97 3.12题 庞涓拿到两个整数(2到99之间)之和,孙膑拿到两个整数之积。下面是一段很有趣的对话。 庞涓说:我不知道这两个整数是多少,但我肯定你也不知道。 孙膑说:我本来不知道这两个整数是多少。但既然你这么说,那我现在知道了。 庞涓说:哦,那我也知道了。 要求输出所有可能的结果,包括这两个整数之和以及这两个整数之积。 程序设计思路:通过庞涓和孙膑的对话,逐步缩小和的范围,直至得出答案!-A difficult mathematical problem (intelligence not to enter the following 140) old Java programming Page97 3.12 title Pang Juan got two integers (2 to 99) the sum, Sun Bin 2 integers to get the product. Here is a very interesting dialogue. Pang Juan wrote: I do not know how much these two integers, but I am sure you do not know. Sun Bin said: I did not know how much of these two integers. However, as you say so, then I now know. Pang Juan said: Oh, I know. Require the output of all possible results, including the sum of these two integers, as well as the product of these two integers. Program design ideas: By Pang Juan and Sun Bin dialogue, gradually narrowing the scope of, and until the answer!
下载说明:请别用迅雷下载,失败请重下,重下不扣分!