This commit is contained in:
Denis Nuțiu 2016-05-26 13:37:14 +03:00
parent 48f10b62e5
commit 9b9abb6bb4

View file

@ -1,10 +1,8 @@
#include <stdio.h>
long int f[1000] = {0};
unsigned long int fib(unsigned long int n) {
unsigned int i;
static long int f[1000] = {0}; // better make it static than global...
f[0] = 0;
f[1] = 1;
@ -25,5 +23,6 @@ int main() {
printf("%ld\n", fib(11));
printf("%ld\n", fib(10));
printf("%ld\n", fib(12));
printf("%ld\n", fib(12));
return 0;
}