From 77b6fbc7043522f9c2237d36d7a50c4e09c705b8 Mon Sep 17 00:00:00 2001 From: cxnnqr Date: Fri, 2 Feb 2024 15:48:27 +0100 Subject: [PATCH] refactoring: use ggT function from previous instead of new one --- src/kgV/kgV.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/kgV/kgV.c b/src/kgV/kgV.c index 0fd539a..a9e61e8 100644 --- a/src/kgV/kgV.c +++ b/src/kgV/kgV.c @@ -1,18 +1,5 @@ #include - -int ggT(int a, int b){ - // handles the zero cases - if(a == 0) return b; - if(b == 0) return a; - - // Euclidean algorithm with modulo for getting the ggT - while (b != 0) { - int temp = b; - b = a % b; - a = temp; - } - return a; -} +#include "ggT.h" int kgV(int a, int b){ return a*b/ ggT(a, b);