#include <stdio.h>
#include <time.h>
long fib (int n) {
return n<=2 ? 1 : fib(n-1)+fib(n-2);
}
void main ()
{ double x;
int n;
for(n=2;n<=45; n++) {
x = clock() / CLOCKS_PER_SEC;
printf("fib(%d)=%ld ",n,fib(n));
x = clock() / CLOCKS_PER_SEC - x;
printf("Timing fib(%d): %f.\n",n,x);
}
return 0;
}