projects
/
libfirm
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Added max recursion depth
[libfirm]
/
ir
/
be
/
test
/
fib.c
1
#include <stdio.h>
2
3
unsigned fib(unsigned n)
4
{
5
if(n == 0)
6
return 0;
7
if(n == 1)
8
return 1;
9
10
return fib(n-1) + fib(n-2);
11
}
12
13
int main(int argc, char** argv) {
14
unsigned n = 8;
15
if(argc > 1)
16
n = (unsigned) atoi(argv[1]);
17
18
printf("Fib %u: %u\n", n, fib(n));
19
20
return 0;
21
}