曾经微软出的java难题,求高手,要新思维!!!
要求程序可以实现:输入一个数,求它的阶层后面有多少个连续的0,将其连续0 的个数输出?????
/** * @param n * @return number of trailing zeros in the factorial of n */ public static int factTrailingZeroes(int n) { int count = 0; while (n >= 5) { n /= 5; count += n; } return count; }