Given an integer n, return the number of trailing zeroes in n!.
给一个数字n,返回它n!数字后面有多少个0。
public class Solution { public int trailingZeroes(int n) { int count=0; while(n/5>=1) { count+=n/5; n/=5; } return count; } }
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3