Skip to content · ⁨Перейти к содержанию⁩

Greatest common divisor · ⁨Наибольший общий делитель⁩

English

Greatest common divisor

The GCD of two numbers is the largest integer that divides both. Euclid's algorithm is beautifully short: while b isn't 0, replace the pair (a, b) with (b, a % b). When b reaches 0, a is the answer.

Русский

Наибольший общий делитель

НОД двух чисел — это наибольшее целое число, которое делит оба. Алгоритм Евклида beautifully короток: пока b не равно 0, замените пару (a, b) на (b, a % b). Когда b достигнет 0, a будет ответом.

Log in or create account · ⁨Войти или создать аккаунт⁩

IGCSE, A-Level & AP