calculation A (n, x, y), 4; Gt; 0, ylt; Gt; 0:00 a.m., with a function call A (n...
计算A(n,x,y),当n0,y0时,用函数调用A(n,x,y-1)代替,其中B=A(n,x,y-1)。在计算A(n,x,y-1)前,应先将参数n,x,y保存起来,待计算出A(n,x,y-1)的值之后,设其值为B,再回来计算A(n,B,x)。如果计算出A(n,x,y-1)时,仍有y-1>0,又要将n,x,y-1保存起来,去计算A(n,x,y-2),...,直到能计算出值,再返回来计算各中间值反复进行这一过程,直到最后求得最初的函数值-calculation A (n, x, y), 4; Gt; 0, ylt; Gt; 0:00 a.m., with a function call A (n, x, y-1) to replace, B = A (n, x, y-1 ). In the calculation of A (n, x, y-1), before first parameter n, x, y saved, the question calculate A (n, x, y-1) value, based Value B, A calculation of return (n, B , x). If calculated A (n, x, y-1), there is still y-1gt; 0, but also to n, x, y-1 saved, the calculation of A (n, x, y-2 ),..., until value can be calculated and then back to calculate the median repeated the process, until the last strike initial function
- 2022-08-21 01:32:18下载
- 积分:1
求阶乘算法(0
求阶乘算法(0---10000)标准C++语言控制台应用程序 可能很多人都曾经想过要实现一些比较大的数的阶乘,但是C++中提供的标准数据类型其存储空间太小,根本无法实现。我们可以通过其他方法来实现,本程序用一个很简单的算法实现数的阶乘,程序很短,也很简单,各处都有注释,相信大家很容易就可以看懂,下载源码后在VC6.0中打开编译后即可运行,程序经少许改动可以实现更大的数的阶乘,有兴趣的读者在看完本程序后可一动手试试,其乐无穷!!希望这个程序能给大家一点帮助-The arithmetic for counting factorial(0-10000)
This is a standard C++ language console application, many people could want to relize the factorial of some large numbers, but the memory space of the standard data type provided by the C++ is too small, so it can not realize at all. But we can realize it by other method, the program realize the factorial of the number you give by a simple arithmetic ,this is a short and easy program, and there are remarks everywhere, I believe that everyone can easily understand it, after downloading the sound code you can open it in VC6.0, then edit and run it. you also can change something to realize the factorial of a larger number, the reader who is interesting in it can have a try, there are more happiness in it!! At last,
- 2023-02-22 10:45:03下载
- 积分:1