Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
71470 朱震耀老师 最大公约数和最小公倍数 Python3 Accepted 32 MS 3772 KB 310 2024-04-24 19:30:16

Tests(1/1):


Code:

def gcd(a, b): """ 求两个整数的最大公约数 """ while b: a, b = b, a % b return a def lcm(a, b): """ 求两个整数的最小公倍数 """ return a * b // gcd(a, b) a, b = list(map(int, input().split())) print(gcd(a, b), lcm(a, b), sep=' ')