求最大公约数最小公倍数,公约数最小公倍数,#!/usr/bin/e
文章由Byrx.net分享于2019-03-23 09:03:29
求最大公约数最小公倍数,公约数最小公倍数,#!/usr/bin/e
#!/usr/bin/env python def calGCD(op1, op2): if (op2==0): return op1 else: return calGCD(op2, op1%op2) def calGCDAndLCM(op1, op2): gcd = calGCD(op1, op2) lcm = op1/gcd*op2 return (gcd, lcm) if __name__=='__main__': op1 = int(raw_input('input the operands: ')) op2 = int(raw_input('input the operands: ')) result = calGCDAndLCM(op1, op2) print result#该片段来自于http://byrx.net
相关内容
- 查看系统启动项,查看系统,#-*- coding:
- python实现百分比和进度条,python百分比,import hashl
- python打印所有汉字,python打印汉字,n=0for ch in
- python输出各位有效数字|global变量,pythonglobal,程序功能
- Python算24点代码,python24点代码,# 算24程序impor
- 字符串匹配算法:KMP,匹配算法kmp,#!/usr/bin/e
- Python发行包下的正则测试工具--NFA引擎,python--nfa,Pyth
- openstack swift client 开发初体验,openstackswift,第一次写p
- 用Python做Port Forwarding,pythonforwarding,import socke
- 非正则判断ip合法性,判断ip合法性,all(map(lamb
评论关闭