[leetcode]Factorial Trailing Zeroes
时间:2015-01-01 00:08:39
收藏:0
阅读:270
老题,简单题。数5的个数就行了。
class Solution {
public:
int trailingZeroes(int n) {
int result = 0;
while (n > 0) {
result += n / 5;
n /= 5;
}
return result;
}
};
原文:http://www.cnblogs.com/lautsie/p/4196761.html
评论(0)