Advertisement
myloyo

7.4.6

Feb 16th, 2023 (edited)
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <string>
  4. #include <fstream>
  5. #include <sstream>
  6. #include <list>
  7.  
  8. using namespace std;
  9. ifstream in("input.txt");
  10. ofstream out("output.txt");
  11.  
  12. int main() {
  13.     string s;
  14.     int c = 0;
  15.     int maxim = -10000000000000;
  16.     getline(in, s);
  17.     for (int i = 0; i < s.length(); i++) {
  18.         if (s[i] <= 57 && s[i] >= 48) {
  19.             c++;
  20.         }
  21.         else {
  22.             maxim = max(c, maxim);
  23.             c = 0;
  24.         }
  25.     }
  26.     out << maxim;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement