Algorytm

Szukamy NWD a i b
Powtarzaj tak długo aż a=b

Wypisz NWD czyli a

Your browser does not support the canvas tag.