Skip to content

Instantly share code, notes, and snippets.

@ozgurkaracam
Created November 28, 2015 10:43
Show Gist options
  • Save ozgurkaracam/5378877b8162d86bec9c to your computer and use it in GitHub Desktop.
Save ozgurkaracam/5378877b8162d86bec9c to your computer and use it in GitHub Desktop.
brutal force yöntemiyle en küçük ortak bölenin bulunması.
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment