euclidss algorithm code example
Example 1: euclid algorithm
def MCD(a,b):
while b != 0:
a, b = b, a % b
return a
Example 2: euclid algorithm
function mcd($a,$b) {
while($b) list($a,$b)=array($b,$a%$b);
return $a;
}
def MCD(a,b):
while b != 0:
a, b = b, a % b
return a
function mcd($a,$b) {
while($b) list($a,$b)=array($b,$a%$b);
return $a;
}