LogIn E-mail
¼³°èÀ̾߱â
import ÆÄÀ̽㠸ðµâ °¡Á®´Ù ¾²±â
# 3 JMJS    19.11.11 09:32

% cat gcd.py
def gcd(a, b):
    if a < b:
        a, b = b, a
    if a % b == 0:
        return b
    return gcd(b, a % b)

if __name__ == '__main__':
    x, y = [int(n) for n in input("Two numbers for GCD:").split()[:2]]
    z = gcd(x, y)
    print("GCD(%d, %d) = %d" % (x, y, z))

% cat lcd.py
import gcd as gcd

def lcd(a, b):
    c = gcd.gcd(a, b)
    d, e = a // c, b // c
    return d * e * c

if __name__ == '__main__':
    x, y = [int(n) for n in input("Two numbers for LCD:").split()[:2]]
    z = lcd(x, y)
    print("LCD(%d, %d) = %d" % (x, y, z))

°Ô½Ã¹°: 21 °Ç, ÇöÀç: 1 / 1 ÂÊ
¹øÈ£ Á¦       ¸ñ ÀÛ¼ºÀÚ µî·ÏÀÏ ¹æ¹®
22  python -m pip install -U pip JMJS 19.11.25 3
21  get =lambda i,m ... JMJS 19.11.13 7
20  2Â÷¿ø ¸®½ºÆ®, Æ©Çà JMJS 19.11.13 6
19  [turtle]def polygon3(n,c,d) JMJS 19.11.11 8
18  [turtle]def polygon2(n,a) JMJS 19.11.11 7
17  def factorial(n) JMJS 19.11.11 7
16  def sum_func(n) JMJS 19.11.11 7
15  def hello() fun1(a) fun2(a,b) JMJS 19.11.11 6
14  while sum JMJS 19.11.11 6
13  random calculation JMJS 19.11.11 6
12  turtle random JMJS 19.11.11 7
11  import time time.time JMJS 19.11.11 7
10  turtle begin_fill end_fill JMJS 19.11.11 7
9  if else JMJS 19.11.11 7
8  input JMJS 19.11.11 8
7  list JMJS 19.11.11 6
6  turtle triangle JMJS 19.11.11 7
5  for range JMJS 19.11.11 6
4  ¸ðµâ »ç¿ëÇϱâ JMJS 19.11.11 8
3  import ÆÄÀ̽㠸ðµâ °¡Á®´Ù ¾²±â JMJS 19.11.11 10
1  print ÁÙ¹Ù²Þ JMJS 19.11.11 35
[1]