2014-05-13 09:36:44 +02:00
|
|
|
#include<stdio.h>
|
|
|
|
|
|
|
|
int fibo(int n){
|
|
|
|
int result;
|
|
|
|
int a = 0;
|
|
|
|
int b = 1;
|
|
|
|
int i = 1;
|
|
|
|
while( i < n )
|
|
|
|
{
|
|
|
|
result = a + b;
|
|
|
|
a = b;
|
|
|
|
b = result;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
2019-07-23 19:14:28 +02:00
|
|
|
int counter = 100000;
|
2014-05-13 09:36:44 +02:00
|
|
|
int fib ;
|
2019-07-23 19:14:28 +02:00
|
|
|
while(counter) {
|
|
|
|
fib += fibo(20);
|
|
|
|
counter -= 1;
|
2014-05-13 09:36:44 +02:00
|
|
|
}
|
|
|
|
}
|