#include <stdio.h>
#include <stdlib.h>
int Count0(int N)
{
int ret = 0, i, j;
for(i = 1; i <= N; i++)
{
j = i;
while(j % 5 == 0)
{
ret++;
j /= 5;
}
}
return ret;
}
int Count02(int N)
{
int ret = 0;
while(N)
{
ret += N / 5;
N /= 5;
}
return ret;
}
int main()
{
int num = Count02(10);
printf("num = %d\n", num);
return 0;
}
#include <stdlib.h>
int Count0(int N)
{
int ret = 0, i, j;
for(i = 1; i <= N; i++)
{
j = i;
while(j % 5 == 0)
{
ret++;
j /= 5;
}
}
return ret;
}
int Count02(int N)
{
int ret = 0;
while(N)
{
ret += N / 5;
N /= 5;
}
return ret;
}
int main()
{
int num = Count02(10);
printf("num = %d\n", num);
return 0;
}