第11103题 程序题
补全Python递归函数计算1x2与1x3积木铺满长度n的总铺法数

小乐用1x2和1x3的乐高积木块横向铺满长度为n(不为0)的积木条,只能使用这两种规格的积木,只能横着铺,不能竖着铺,求不同的铺法总数。

请补全以下Python代码中的空缺部分(①②③④)实现该功能:

def          ①        :
    if          ②        :
        return 0
    if x == 2 or x == 3:
        return          ③        
    return          ④        
n = int(input())
print(calc(n))
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
编辑模式
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析