/*
Given a number find the number of trailing zeroes in its factorial.
Input Format
A single integer - N
Output Format
Print a single integer which is the number of trailing zeroes.
Input Constraints
1 <= N <= 1000
*/
#include <stdio.h>
int main(){
int main(){
int i,N,z,k;
scanf("%d",&N);
z=0;
k=1;
i=1;
while(1){
k=(int)(N/pow(5,i));
if(k<1) break;
z+=k;
i++;
}
printf("%d",z);
return 0;
}
0 comments:
Post a Comment