class Solution {public: int trailingZeroes(int n) { int count = 0; while (n) { count += n / 5; n = n / 5; } return count; }};
class Solution {
public:
int trailingZeroes(int n) {
int count = 0;
while (n)
{
count += n / 5;
n = n / 5;
}
return count;
};
Factorial Trailing Zeroes
原文:http://www.cnblogs.com/flyjameschen/p/4316706.html