#include
#include
using namespace std;
int main(){
int TC,i,count=0;
unsigned long ip;
scanf("%d",&TC);
while(TC–){
i=5;
scanf("%lu",&ip);
while(i<=ip){
count+=ip/i;
i*=5;
}
printf("%d",count);
count=0;
}
return 0;
}
For input
4
5
10
15
20
it returns 1234
…
2 Likes
thanks!!! forgot to print each answer on a new line!!!
1 Like