fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. const int TEN = 10;
  6.  
  7. int maxCons0(long long no) {
  8. int cons = 0, firstattempt = 0, rez = 0;
  9. while (no > 0) {
  10. if (no % TEN == 0) {
  11. ++cons;
  12. } else {
  13. if (cons > rez) {
  14. rez = cons;
  15. }
  16. cons = 0;
  17. }
  18. no /= TEN;
  19. }
  20. if (cons > rez) {
  21. rez = cons;
  22. }
  23. return rez;
  24. }
  25.  
  26. int main() {
  27. long long no = 10e18;
  28. //cin >> no;
  29. cout << maxCons0(no);
  30. return 0;
  31. }
Success #stdin #stdout 0s 5280KB
stdin
1000000
stdout
1