阶乘中的0的个数和因数中有多少个因子5相等。
int count=0;
while(n)
{
count+=n/5;
n/5;
}
return count;
}
Z = N/5 + N /(5*5) + N/(5*5*5).....直到N/(5的K次方)等于0
int zeroCount(int n)
{int count=0;
while(n)
{
count+=n/5;
n/5;
}
return count;
}