求最大公约数

r=a%b

if r==0 then

   gcd=b

else

  a=b

 b=r

 继续上面操作

lcm最小公倍数

原文地址:https://www.cnblogs.com/vanishfan/p/4599590.html