C++递推实现斐波那契数列函数,空缺处应填入的代码是?
int fib(int n) {
if (n == 0 || n == 1)
return n;
int f1 = 0;
int f2 = 1;
int result = 0;
for (int i = 2; i <= n; i++) {
_________________________ // 在此处填入代码
}
return result;
}
正在加载题目数据…
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析