updating
This commit is contained in:
parent
48f10b62e5
commit
9b9abb6bb4
1 changed files with 2 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue