求高手指点一个超级复杂的C程序
Double recursion functionAckermann Function is defined as
ack(0,n) = n + 1
ack(m,0) = ack( m-1, 1)
ack(m,n) = ack( m – 1, ack( m, n – 1 ))
For example
ack( 1, 1 )
= ack ( 0, ack ( 1, 0 ) )
= ack ( 0 , ack( 0, 1 ) )
= ack ( 0, 2 )
= 3
Try to work out ack( 1 , 2 ) and ack ( 1, 3 ) by hand.
Write a program that will accept two parameters and display the value of the corresponding Ackermann function. For example:
$ ack 1 1
The Ackermann value of ack(1,1) is 3
Using your program, try to find out the values of ack(2,3), ack(3,2) and ack(4,2).
WARNING!!!! It may not be as easy as it looks