def myfun():
num1 = int(input('输入num1'))
num2 = int(input('输入num2'))
list1=[]
for i in range(1, max(num1, num2)):
if num1 % i == 0 and num2 % i == 0:
list1.append(i)
print('最大公约数:',max(list1) )
print('最小公倍数:',num1 * num2 // max(list1))
myfun()
转载于:https://www.cnblogs.com/menxin/p/9887228.html