22 lines
284 B
C
22 lines
284 B
C
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
int fibonacci(int rang){
|
||
|
if (rang==0){
|
||
|
return 0;
|
||
|
}
|
||
|
else{
|
||
|
if (rang==1){
|
||
|
return 1;
|
||
|
}
|
||
|
else{
|
||
|
return fibonacci(rang-1) + fibonacci(rang-2);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
int main(void){
|
||
|
printf("%d\n",fibonacci(15));
|
||
|
return 0;
|
||
|
}
|