摘要:
GCD is the greatest common divisor. pseudo-code:function Euclid(x,y)if y==0 return x;return Euclid(y, x MOD y).correctness:Euclid's rule: If x and y are positive integers with x >= y, then gcd(x, y) = gcd(x mod y, y).Prove: just to prove gcd(x, y) = gcd(x-y, y). Let GCD is k, then if k can di 阅读全文