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)
|
|
|
|
{
|
|
|
|
int counter = 1000000;
|
|
|
|
int counter2 = counter;
|
2015-11-20 18:12:13 +01:00
|
|
|
int level = 40;
|
2014-05-13 09:36:44 +02:00
|
|
|
int fib ;
|
2015-11-20 18:12:13 +01:00
|
|
|
while(counter--) {
|
2014-05-13 09:36:44 +02:00
|
|
|
fib = fibo(level);
|
|
|
|
}
|
|
|
|
printf("%i times fib %d \n",counter2 , level);
|
2015-11-20 18:12:13 +01:00
|
|
|
|
2014-05-13 09:36:44 +02:00
|
|
|
}
|