class Solution: """ @param: n: An integer @return: An integer, denote the number of trailing zeros in n! """ def trailingZeros(self, n): # write your code here, try to do it without arithmetic operators. res = 0 tp = 5 while n/tp>=1: res = res + int(n/tp) tp = tp * 5 return res
Python, LintCode, 2. 尾部的零
猜你喜欢
转载自blog.csdn.net/u010342040/article/details/80068593
今日推荐
周排行