🔗 팩토리얼의 0의 개수 백준 1676문제
package math;

import java.util.Scanner;

public class Factorial {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int count = 0;
        for(int i = 5; i <= n; i*=5) {
            count += n/i;
        }
        System.out.println(count);
    }
}


💎결과

image-20220130215748022


함께 읽으면 좋은 글

카테고리:

업데이트:

댓글

이 글이 도움이 됐다면?

같은 카테고리의 다른 글도 확인해보세요

더 많은 글 보기 →