“Euklidalgorithmus” Code-Antworten

GCD -Algorithmus

function gcd(a, b)
    if b = 0
        return a
    else
        return gcd(b, a mod b)
Good Gull

Euklidalgorithmus

int Euclid(int a, int b)
{
    int r;
    while(b != 0) 
    {
         r = a % b;
         a = b; 
         b = r; 
    }
    return a; 
}
Phil the ice cream man

Euklidalgorithmus

 function mcd($a,$b) {
	while($b) list($a,$b)=array($b,$a%$b);
	return $a;
}
Phil the ice cream man

Euclids Algorithmus

def GCF(a,b):
  if a == b: return a
  else: return GCF(abs(a-b), min(a,b))
Wicked Willet

Euklidalgorithmus

def MCD(a,b):
    while b != 0:
        a, b = b, a % b
    return a
Phil the ice cream man

Ähnliche Antworten wie “Euklidalgorithmus”

Fragen ähnlich wie “Euklidalgorithmus”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen