标签:
题目描述:public class Solution { public int TrailingZeroes(int n) { var c = 0; var factor = 5; var end = int.MaxValue / 5; while(n >= factor && factor != int.MaxValue){ c += n/factor; if(factor > end){ factor = int.MaxValue; } else{ factor *= 5; } } return c; } }
版权声明:本文为博主原创文章,未经博主允许不得转载。
LeetCode -- Factorial Trailing Zeroes
标签:
原文地址:http://blog.csdn.net/lan_liang/article/details/48896997