Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- string line;
- cout << "Enter numbers: ";
- getline(cin, line);
- string::size_type k = 0, maxLine = 0, lineLen = line.length();
- for(unsigned int i = 0; i != lineLen; ++i)
- {
- if (isdigit(line[i]))
- ++k;
- else
- {
- if (k > maxLine)
- maxLine = k;
- k = 0;
- }
- }
- if (k > maxLine)
- maxLine = k;
- cout <<"Max Line: " << maxLine << endl;
- system ("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement