class Solution {
public int trailingZeroes(int n) {
int num = 0;
while(n>0) {
num += (n/5);
n /= 5;
}
return num;
}
}
class Solution {
public int trailingZeroes(int n) {
int num = 0;
while(n>0) {
num += (n/5);
n /= 5;
}
return num;
}
}
本文标题:leetcode172:阶乘后的零
本文链接:https://www.haomeiwen.com/subject/pketsftx.html
网友评论