Have you met this question in a real interview?
求阶乘里5的个数,数学题~
while(n一直除以5)就好啦
class Solution {
public:
int trailingZeroes(int n) {
int res=0;
while(n=n/5){
res+=n;
}
return res;
}
};