首页 > 代码库 > [leetcode]Factorial Trailing Zeroes

[leetcode]Factorial Trailing Zeroes

老题,简单题。数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