m=int(input("enter m:")) n=int(input("enter n:")) if m>n: min=n else: min=m for i in range(min,0,-1): if m%i==0 and n%i==0: break for j in range(1,m*n+1): if j%m==0 and j%n==0: break print("最大公约数:"+str(i)+" 最小公倍数:"+str(j))