# 172.Factorial Trailing Zeroes

**172.Factorial Trailing Zeroes**

难度:Easy

> 给定一个整数 n，返回 n! 结果尾数中零的数量。

```
示例 1:

输入: 3
输出: 0
解释: 3! = 6, 尾数中没有零。
示例 2:

输入: 5
输出: 1
解释: 5! = 120, 尾数中有 1 个零.
说明: 你算法的时间复杂度应为 O(log n) 。
```

方法：主要是找出5的个数，代码如下：

```
class Solution {
public:
    int trailingZeroes(int n) {
        int t=n/5;
        int total=t;
        while(t>4)
        {
            t/=5;
            total+=t;
        }

        return total;
    }
};
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dfine.gitbook.io/leetcode/172.factorial_trailing_zeroes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
