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 5 and, for
each k, the corresponding number of zeroes is
∑_(i > 0)x/5^(i).

Input

Input consists of an integer number.

Precondition

It holds 0< @x@ < 10⁹.

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
