(答案来自题目后面评论区) 提交代码: class Solution { public int trailingZeroes(int n) { return n == 0 ? 0 : n / 5 + trailingZeroes(n / 5); } } 运行结果: