FCTRL : wrong answer but running properly on my system

#include<stdio.h>
int main()
{
int i,n,b=5,c,m=0;
long long a;
scanf("%d",&n);
for(i=0;i<n;i++)
{
b=5;
scanf("%ld",&a);
while(b<a){
c=a/b;
b*=5;
m+=c;
}
printf("%d\n",m);
m=0;
}
return 0;
}

You are missing the cases which are powers of 5 such as 25,125,625…
Accepted Submission:CodeChef: Practical coding for everyone

1 Like