First NIT release and new clean mercurial repository
[nit.git] / tests / bench_fib_ref.c
1 #include <stdio.h>
2
3 int fib(int c)
4 {
5 if (c <= 0)
6 return 0;
7 else if (c < 2)
8 return 1;
9 else
10 return fib(c-1) + fib(c-2);
11 }
12
13 int main(int argc, char ** argv)
14 {
15 printf("%d\n", fib(atoi(argv[1])));
16 return 0;
17 }