PythonNumbermath.gcd

Returns the greatest common divisor of the given integers.

문법

math.gcd(*integers)

예제

아래 값을 입력하면 예제에 즉시 반영됩니다.

import
math
print
gcd
import math
print(math.gcd(12, 8))     # 4
print(math.gcd(100, 75))   # 25