第27611题 单选题
假设爬楼梯需要n阶到达楼顶,每次可爬1或2个台阶,以下哪个代码片段可以正确计算到达楼顶的不同方法数?

已知爬楼梯问题的合法方法数满足:当n=1时只有1种方法,n=2时有2种方法,n≥3时方法数为前两阶方法数之和

{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析