Number of zeros in the factorial

Implement the function

    int nzeros_fact(int x);

which returns the number of ending zeroes in its factorial.

Take into account that ending zeros correspond to powers of 55 and, for each kk, the corresponding number of zeroes is i>0x/5i.\sum_{i>0} x/5^i.

Input

Input consists of an integer number.

Precondition

It holds 0<0 < @x@<109< 10^9.

Observation

You only need to submit the required procedure; your main program will be ignored.

Problem information

Author: Unknown
Translator: Maria Serna

Generation: 2026-01-25T17:34:30.091Z

© Jutge.org, 2006–2026.
https://jutge.org