题目描述
给出一个整数N,求N阶乘中有几个0。
乘法得到0就是2*5,2的数量不知比5多到哪里去了,只要计算5的数量就行,那就一直除于5,计算即可。
Given an integer n, return the number of trailing zeroes in n!.
Note: Your solution should be in logarithmic time complexity.
1 |
public class { |
给出一个整数N,求N阶乘中有几个0。
乘法得到0就是2*5,2的数量不知比5多到哪里去了,只要计算5的数量就行,那就一直除于5,计算即可。
Given an integer n, return the number of trailing zeroes in n!.
Note: Your solution should be in logarithmic time complexity.
1 |
public class { |
近期评论