프로그래밍 언어/JAVA 4

백준 > 1676 팩토리얼 0의 개수

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int count = 0; while (n > 4) { count += n / 5; n /= 5; } System.out.println(count); } } Colored by Color Scripter cs 어렵지 않은 문제였지만 여러 번 틀렸다. 이유는 1. 5의 제곱수를 생각하지 못함 2. 5로 나누면 안된다는 사실을 이해하지 못했음 2번이 이해가 좀 안되었었는데 https..