用户:颖林mIOR查看:0 回复:0 评论:0 创建时间:2023-04-04T21:28:44
【作品展示】

【作品介绍】
分别输入两个正整数,输出他们的公约数的数量。python一级最后一题。
感谢:NCT备考辅导中心
【作品源代码】
x = int(input())
y = int(input())
n = 0
if x>y:
t = y
else:
t = x
for i in range(1,t+1):
if x%i == 0 and y%i == 0:
n += 1
print(n)
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn