Skip to content

Instantly share code, notes, and snippets.

@austa
Created December 13, 2013 18:29
Show Gist options
  • Save austa/7948888 to your computer and use it in GitHub Desktop.
Save austa/7948888 to your computer and use it in GitHub Desktop.
#hantal
def hantal_obeb(sayi1, sayi2):
kucukSayi = kucuk_bul(sayi1, sayi2)
for i in range(kucukSayi,1,-1):
if sayi1 % i == 0 and sayi2 % i == 0:
return i
def kucuk_bul(m,n):
kucuk = m
if n < m:
kucuk = n
return kucuk
sayi1 = 1024
sayi2 = 32
print hantal_obeb(sayi1, sayi2)
#en hizli
def gcd(m,n):
while m%n != 0:
old m = m
oldn = n
m = oldn
n = oldm % oldn
return n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment