# leetcode 172 Factorial Trailing Zeroes C++

    int trailingZeroes(int n) {
if(n==0) return 0;
int num = 0;
if(n/5<5) return n/5;
int tmp;
while((tmp = n/5) != 0){
num += tmp;
n=tmp;
}
return num;
}

• 本文已收录于以下专栏：

## leetcode 172. Factorial Trailing Zeroes

DescriptionGiven an integer n, return the number of trailing zeroes in n!.Note: Your solution should...

## leetcode172：Factorial Trailing Zeroes

• hjxzb
• 2015年04月07日 10:37
• 459

## <LeetCode OJ> 172. Factorial Trailing Zeroes

172. Factorial Trailing Zeroes My Submissions Question Total Accepted: 45801 Total Submissions: ...

## leetcode-172 Factorial Trailing Zeroes

• sole_cc
• 2015年04月14日 18:28
• 303

## LeetCode172——Factorial Trailing Zeroes

LeetCode172——Factorial Trailing Zeroes Given an integer n, return the number of trailing zeroes...

## Leetcode Problem.172—Factorial Trailing Zeroes

Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in lo...

## 171. Excel Sheet Column Number\172. Factorial Trailing Zeroes\134. Gas Station\135. Candy

Excel Sheet Column Number 题目描述 代码实现 Factorial Trailing Zeroes 题目描述 代码实现 Gas Station 题目描述 代码实现 Candy ...

举报原因： 您举报文章：leetcode 172 Factorial Trailing Zeroes C++ 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)