return n == 0 ? 0 : n / 5 + trailingZeroes3(n / 5);
}
int main(int argc, char* argv[])
{
int n;
int oput;
int t;
scanf("%d",&n);
do{
t=GetTickCount();
oput=trailingZeroes0(n);
t=GetTickCount()-t;
printf("0st func time %dms, Trailing zeroes is %d\n",t,oput);
t=GetTickCount();
oput=trailingZeroes1(n);
t=GetTickCount()-t;
printf("1st func time %dms, Trailing zeroes is %d\n",t,oput);
t=GetTickCount();
oput=trailingZeroes2(n);
t=GetTickCount()-t;
printf("2nd func time %dms, Trailing zeroes is %d\n",t,oput);
t=GetTickCount();
oput=trailingZeroes3(n);
t=GetTickCount()-t;
printf("3nd func time %dms, Trailing zeroes is %d\n",t,oput);
scanf("%d",&n);
}while(n!=0);
return 0;
}
/*
1808548329
10
*/
1999999999 0st func time 9812ms, Trailing zeroes is 499999988 1st func time 4321ms, Trailing zeroes is 499999988 2nd func time 0ms, Trailing zeroes is 499999988 3nd func time 0ms, Trailing zeroes is 499999988