def computeit(limit):
dsts = xrange(1, limit + 1)
b, p = 0, 0
rst = dsts
while rst:
base = 5**p
rst = [x for x in rst if x/base % 5 == 0]
if rst:
b += len(rst)
p += 1
return b
computeit(300)
computeit(500000)
标签:python,累乘
版权声明:文章由 百问十五 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.baiwen15.com/answer/111841.html