Created
November 28, 2015 10:43
-
-
Save ozgurkaracam/5378877b8162d86bec9c to your computer and use it in GitHub Desktop.
brutal force yöntemiyle en küçük ortak bölenin bulunması.
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
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