fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define ll long long
  5.  
  6. int main()
  7. {
  8. int t;
  9. ll n,x,y,ans;
  10. cin >> t;
  11. while(t--)
  12. {
  13. cin >> n;
  14. ans = 0;
  15. y = 1; // to go in the loop initially
  16. x = 5;
  17. while(y)
  18. {
  19. y = n/x;
  20. ans += y;
  21. x*=5;
  22. }
  23. cout << ans << endl;
  24. }
  25. }
  26.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Standard output is empty