diff --git a/src/ggT/ggT.c b/src/ggT/ggT.c index 484acb6..cccb8e9 100644 --- a/src/ggT/ggT.c +++ b/src/ggT/ggT.c @@ -2,12 +2,10 @@ int ggT(int a, int b){ - while(a != b){ - if(a < b){ - b -= a; - } else { - a -= b; - } + while (b != 0) { + int temp = b; + b = a % b; + a = temp; } return a; } \ No newline at end of file