Skip to content
Algorithm.js | Algorithm in JavaScript
Frame

GCD (Greatest Common Divisor) 최대공약수

유클리드 호제법으로 두 수의 최대공약수를 재귀적으로 계산하는 원리와 구현 요약

Oct 29, 2025
const gcd = (a, b) => {
if (b === 0) return a;
return gcd(b, a % b);
}

기본 문제들

응용 문제들