最大公约数 python表达
#!/usr/bin/env pythondef cal易做图(op1, op2):
if (op2==0): return op1
else: return cal易做图(op2, op1%op2)
def cal易做图AndLCM(op1, op2):
易做图 = cal易做图(op1, op2)
lcm = op1/易做图*op2
return (易做图, lcm)
if __name__=='__main__':
op1 = int(raw_input('input the operands: '))
op2 = int(raw_input('input the operands: '))
result = cal易做图AndLCM(op1, op2)
print result
摘自 Z1Y7T的博客
补充:Web开发 , Python ,