标签:
老题,简单题。数5的个数就行了。
class Solution {
public:
int trailingZeroes(int n) {
int result = 0;
while (n > 0) {
result += n / 5;
n /= 5;
}
return result;
}
};
[leetcode]Factorial Trailing Zeroes
标签:
原文地址:http://www.cnblogs.com/lautsie/p/4196761.html