Răspuns :
int nz(int n) // Numarul de Zerouri al lui Factorial de X
{
int c=n/5;
c+=n/25;
c+=n/125;
c+=n/625;
c+=n/3125;
c+=n/15625;
c+=n/78125;
c+=n/390625;
c+=n/1953125;
c+=n/9765625;
c+=n/48828125;
c+=n/244140625;
c+=n/1220703125;
return c;
}
{
int c=n/5;
c+=n/25;
c+=n/125;
c+=n/625;
c+=n/3125;
c+=n/15625;
c+=n/78125;
c+=n/390625;
c+=n/1953125;
c+=n/9765625;
c+=n/48828125;
c+=n/244140625;
c+=n/1220703125;
return c;
}
int nz(int m)
{
int s = 0, p = 5;
while(p <= m)
{
s = s + m / p;
p = p * 5;
}
return s;
}
{
int s = 0, p = 5;
while(p <= m)
{
s = s + m / p;
p = p * 5;
}
return s;
}