Skip to content

Instantly share code, notes, and snippets.

@ochko
Created June 15, 2011 17:48
Show Gist options
  • Save ochko/1027646 to your computer and use it in GitHub Desktop.
Save ochko/1027646 to your computer and use it in GitHub Desktop.
def factorial_zeros_count(x):
res = 0
div = 5
while(x >= div):
res += x / div
div *= 5
return res
n = int(input())
for i in range(n):
x = int(input())
print(factorial_zeros_count(x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment