Problem Solving/BOJ
[Silver 4] 1676번 팩토리얼 0의 개수
kmkunk
2022. 3. 25. 16:38
import java.io.*;
public class Main {
public static void main(String[] agrs) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int five = 0;
for(int i=2; i<=n; i++) {
int temp = i;
while(temp%5==0) {
five++;
temp = temp/5;
}
}
System.out.println(five);
}
}