private static int numOfZero(int n) {
int count = 0;
int data = 1;
for (int i = 1; i <= n; i++) {
data = data * i;
while (data % 10 == 0) {
count++;
data = data / 10;
}
data = data % 10;// 只保留个位数字,因其它位数字对0的个数无影响
}
return count;
}
posted on 2009-08-21 00:45
jadmin 阅读(88)
评论(0) 编辑 收藏