[ create a new paste ] login | about

Link: http://codepad.org/taXvb0oe    [ raw code | output | fork ]

C++, pasted on May 13:
#include <cstring>
#include <iostream>
using namespace std;

int main(){
    int i, m, n;
    const char* str = "4730 12417 389238";
    for( i = n = m = 0; str[i]; i++ ){
        if( isdigit(str[i]) )
            n++;
        else
        {
            if( m < n )
                m = n;
            n = 0;
        }
    }
    if( m < n )
        m = n;
    cout<<"max digit count : "<<m<<endl;
    cin.get();
    return 0;
}


Output:
1
max digit count : 6


Create a new paste based on this one


Comments: