Дан ряд Фибоначчи. Найти n-элемент решения.
# include <stdio.h>int phi(int x){int i,k=0;if(x>1)k+=phi(x-1)+phi(x-2);if(x<2)k=x;return k;} int main (void){int x;scanf("%d",&x);printf("%d",phi(x));return 0;}
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
# include <stdio.h>
int phi(int x){
int i,k=0;
if(x>1)k+=phi(x-1)+phi(x-2);
if(x<2)k=x;
return k;}
int main (void){
int x;
scanf("%d",&x);
printf("%d",phi(x));
return 0;}