from math import gcd print( gcd(20,8) ) # 4 print( gcd(12,21) ) # 3
4 3
def gcd(a,b): while b > 0: a, b = b, a % b return a print( gcd(12,21) ) # 3 print( gcd(20,8) ) # 4
CC-BY-SA 3.0 · Powered by MediaWiki
개인정보처리방침 · ABOUT