跳至主要内容

172. 阶乘后的零

class Solution {
public:
    int trailingZeroes(int n) {
        int total = 0;
        while (n >= 1)
        {
            n /= 5;
            total += n;
        }
        return total;
    }
};

评论

此博客中的热门博文