diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-09-18 20:13:23 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-09-18 20:13:23 +0000 |
commit | 4e184742583aa4c65e9073c2767124af5117ee50 (patch) | |
tree | b5ed6e0ef5bda832401eaffc2dd9f7f2110e7d04 /doc | |
parent | 90ab9d7555614e7cd322e6373fca36d414ee9393 (diff) | |
download | cflow-4e184742583aa4c65e9073c2767124af5117ee50.tar.gz cflow-4e184742583aa4c65e9073c2767124af5117ee50.tar.bz2 |
New sample source
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ack.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/ack.c b/doc/ack.c new file mode 100644 index 0000000..46fd304 --- /dev/null +++ b/doc/ack.c @@ -0,0 +1,14 @@ +/* Ackermann's function */ + +typedef unsigned long u_long; + +u_long +ack (u_long a, u_long b) +{ + if (a == 0) + return b + 1; + if (b == 0) + return ack (a - 1, 1); + return ack (a - 1, ack (a, b - 1)); +} + |