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

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

def gcd(a,b):
    m=a%b
    if m==0:
        return  ①
    else:
        a=b
        ②        
        return ③
print(gcd(12,18))
代码编辑器
测试用例输入
{{resultStatus.text}}