Untitled

mail@pastecode.io avatar
unknown
python
7 months ago
396 B
1
Indexable
Never
def gcd(a, b):
    if a == 0:
       return b
    while b != 0:
        if a > b:
           a = a - b
        else:
           b = b - a
    return a
    
if __name__ == "__main__":
    print(f"Le PGCD de 42 et 4 est: {gcd(42, 4)}")
    print(f"Le PGCD de 56 et 64 est: {gcd(56, 64)}")
    print(f"Le PGCD de 33 et 11 est: {gcd(33, 11)}")
    print(f"Le PGCD de 100 et 128 est: {gcd(100, 128)}")
Leave a Comment