第38442题 单选题
小杨正在爬楼梯,需要爬 阶才能到达楼顶。如果每次可以爬 个或 个台阶,下面代码采用递推算法来计算 一共有多少种不同的方法可以爬到楼顶,则横线上应填写( )。
int f(int n) {
if (n == 1 || n == 2)
return n;

int f1 = 1;
int f2 = 2;
int res = 0;
for (int i = 3; i <= n; i++) {
________________________________ // 在此处填入代码
}
return res;
}
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
知识点:
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析