fork download
  1. #include <iostream>
  2. #include <cmath>
  3. #include <cstdio>
  4. using namespace std;
  5.  
  6. int main() {
  7. // your code goes here
  8. int a, b, c;
  9. cin>>a;
  10. while(a--) {
  11. cin>>b;
  12. c=0;
  13. for (int i=1; pow(5, i)<=b; i++) {
  14. c=c+b/pow(5, i);
  15. //i++;
  16. }
  17. cout<<c<<endl;
  18. }
  19. return 0;
  20. }
Success #stdin #stdout 0s 3300KB
stdin
6
5
10
25
1024
23456
8735373
stdout
1
2
6
253
5861
2183837