dddd


/**
 * 第二題的解法
 *
 * @author LvGuoFei
 * @version 創建時間:2016-9-18 下午11:37:54
 * @version <h3>This class of code that there will be no mistake, amen</h3>
 */
public class Reply {
    /**
     * 統計階乘數據中出現零的個數
     *
     * @param i
     * @return
     * @author LvGuoFei
     */
    private static int zeroNum(int i) {
        int zn = i / 5;
        int aa = cs(zn);
        aaj = 0;
        zn = zn + aa;
        return zn;
    }

    private static int aaj = 0;

    private static int cs(int i) {
        int j = i / 5;
        if (j >= 5) {
            aaj += j;
            cs(j);
        } else {
            aaj += j;
        }
        return aaj;
    }

    public static void main(String[] args) {
        System.out.println(zeroNum(1259));
    }

}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章