热门

最新

红包

立Flag

投票

同城

我的

发布
qq_67038110
Want409
3 年前
trueqq_67038110

路遥千里,难断相思。人虽不至,心向往之。无言又无语,若即又若离。我思念着你,我深爱着你;情人节快乐

恋爱交友区
CSDN App 扫码分享
分享
评论
点赞
打赏
  • 复制链接
  • 举报
下一条:
#求两个给定正整数的最大公约数和最小公倍数def hcf(x,y): if x>y: smaller = y else: smaller = x for i in range(1,smaller+1): if(x % i ==0) and (y % i == 0): hcf = i return hcfdef lcm(x,y): if x>y: greater = x else: greater = y while(True): if(greater % x ==0) and (greater % y == 0): lcm = greater return lcm(x, y) num1 = int(input("输入第一个数字:"))num2 = int(input("输入第二个数字:"))print("最大公约数为",hcf(num1,num2),"最小公倍数为",lcm(num1,num2))请问有大神可以看出有什么问题吗?我输入数字之后得不出结论是怎么回事呀!!小白在线求助
立即登录