第17985题 程序题
完善辗转相除法递归求最大公约数的Python代码

辗转相除法求最大公约数,下列函数是用递归算法实现的,请完善横线处的代码。

def gcd(a,b):
    m=a%b
    if m==0:
        return  ①
    else:
        a=b
        ②        
        return ③
print(gcd(12,18))
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
编辑模式
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析