Skip to content

Instantly share code, notes, and snippets.

@ozgurkaracam
Last active November 15, 2015 09:06
Show Gist options
  • Save ozgurkaracam/67b95f0abd0f19925b84 to your computer and use it in GitHub Desktop.
Save ozgurkaracam/67b95f0abd0f19925b84 to your computer and use it in GitHub Desktop.
En Büyük Ortan Bölen Fonksiyonu
#Özgür KARAÇAM
#14060824
def obeb(a,b):
ebob=1
bolen=2
while bolen<=a and bolen<=b:
if(a%bolen==0 and b%bolen==0):
ebob=bolen
bolen=bolen+1
return ebob
def ekok(a,b):
okek=1
bolen=2
while bolen<=a and bolen <=b:
if(a%bolen==0 and b%bolen==0):
a=a/bolen
b=b/bolen
okek=okek*bolen
else:
if(a%bolen==0):
a=a/bolen
okek=okek*bolen
if(b%bolen==0):
b=b/bolen
okek=okek*bolen
bolen=bolen+1
okek=okek*a*b
return int(okek)
print (obeb(25,10))
print (ekok(25,10))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment