The number of 0s after the stratum

Given an integer  n , return  n ! The number of zeros in the mantissa of the result.

 

 1 class Solution {
 2 public:
 3     int trailingZeroes(int n) {
 4       int count = 0;
 5       while(n>0){
 6         count+=n/5;
 7          n/=5;
 8      }
 9         return count;
10     }
11 };

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325856703&siteId=291194637