Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user = str(input())
- a,b,c = user.split(',')
- a = int(a)
- b = int(b)
- c = int(c)
- loop = True
- lcm = 1
- if a>b and a>c:
- high = a
- elif b>a and b>c:
- high = b
- else:
- high = c
- while loop:
- for i in range(2,high):
- if a%i==0 and b%i==0 and c%i==0:
- a /= i
- b /= i
- c /= i
- lcm *= i
- break
- elif a%i==0 and b%i==0:
- a /=i
- b /=i
- lcm *=i
- break
- elif b%i==0 and c%i==0:
- b/=i
- c/=i
- lcm *=i
- break
- elif a%i == 0 and c%i==0:
- c/=i
- a/=i
- lcm *=i
- break
- else:
- lcm *= a*b*c
- loop = False
- print(lcm)
Add Comment
Please, Sign In to add comment