test01.py 282 字节
Newer Older
6
643ba23685c1575eeb20855c 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
def main():
    a = int(input("请输入a的值:"))
    b = int(input("请输入b的值:"))
    if b == 0:
        print("data error")
        return -1
    else:
        c = a % b
        while c != 0:
            a = b
            b = c
            c = a % b
    print(b)


main()