Advertisement
askarulytarlan

#0043 - Нули

Mar 27th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <cmath>
  4. #include <vector>
  5. #include <algorithm>
  6. #include <cstdio>
  7. #include <math.h>
  8. #include <string>
  9. #include <stdio.h>
  10. #include <string.h>
  11. #include <string>
  12. #include <stdlib.h>
  13. #include <cmath>
  14. #include <iomanip>
  15. #include <queue>
  16. #include <utility>
  17. #include <vector>
  18. #include <stack>
  19. #include <list>
  20. #include <iterator>
  21. #include <cctype>
  22. #include <exception>
  23. #include <cstdlib>
  24. #include <stdexcept>
  25. #include <csignal>
  26. #include <pthread.h>
  27.  
  28. using namespace std;
  29.  
  30. int main(int argc, const char * argv[]) {
  31.  
  32. string number;
  33. int countZero=0;
  34. int maxZero=0;
  35. cin>>number;
  36. for(int i=0; i<number.length();i++){
  37. if (number[i] == '0'){
  38. countZero++;
  39. }
  40. if (countZero>maxZero){
  41. maxZero=countZero;
  42. }
  43.  
  44. if (number[i]=='1'){
  45. countZero=0;
  46.  
  47. }
  48.  
  49. }
  50. cout<<maxZero<<endl;
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement