曾经微软出的java难题,求高手,要新思维!!!
要求程序可以实现:输入一个数,求它的阶层后面有多少个连续的0,将其连续0 的个数输出?????
2011-04-14 12:23
2011-04-14 16:24
2011-04-14 22:01

程序代码:
/**
* @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;
}
2011-04-14 22:39

2011-04-18 18:21
2011-04-18 20:41
2011-04-18 20:50
2011-04-18 20:58

2011-04-19 13:23
2011-04-19 13:59