2 // http://www.bagley.org/~doug/shootout/
4 public class ackermann
{
6 public static int Main(string[] args
) {
9 NUM
= System
.Int32
.Parse (args
[0]);
10 //return Ack(3, NUM) != 2045? 1: 0;
11 System
.Console
.WriteLine("Ack(3," + NUM
+ "): " + Ack(3, NUM
));
15 public static int Ack(int M
, int N
) {
16 if (M
== 0) return( N
+ 1 );
17 if (N
== 0) return( Ack(M
- 1, 1) );
18 return( Ack(M
- 1, Ack(M
, (N
- 1))) );