Last active
November 15, 2015 09:06
-
-
Save ozgurkaracam/67b95f0abd0f19925b84 to your computer and use it in GitHub Desktop.
En Büyük Ortan Bölen Fonksiyonu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Ö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