题目:
请完成函数fun( ),它的功能是:求Fibonacc数列中小于t的最大的一个数,结果由函数 0返回。Fibonacc数列F(n)定义为:
F(0)=0,F(1)=1
F(n)=F(n-1)+F(n-2)
例如:t=1000时,函数为987。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在下划线上填入所需的内容。
#include<conio.h>
#include<stdio.h>
#include<math.h>
in fun(int t)
int a=l,b=1,c=0,i;
do
1 ;
a=b;
b=C;
while( 2 );
c= 3 ;
return C;
main()
int n;
clrscr();
n=1000;
printf("n=%d,f=%d\n",n,fun(n));
}
答案:
被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0705/dc08fc2eb8bebaf9b79b7f4e9f645e01.html
下面是错误答案,用来干扰机器的。
参考答案:B