题解 | 阶乘尾零

阶乘尾零

https://www.nowcoder.com/practice/434922f9f4724b97b83c417e884008f1

#include <cmath>
class Factor {
public:
    int getFactorSuffixZero(int n) {
        // write code here
        int res =0;
        while (n) {
            n /=5;
            res+=n;   
        }
     
        return res;
    }
};

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务