Write a function. The original form is int continumax (char * outputstr, char * intputstr)
Function:
Find the longest consecutive numeric string in the string and return the length of the string,
And pay the longest numeric string to the memory specified by one of the function parameters outputstr.
For example, after the first address of "abcd12345ed125ss123456789" is passed to intputstr, the function returns 9,
# Include <iostream> using namespace STD; int continuemax (char * output, const char * input) {If (input = NULL) return 0; const char * hegin = NULL; int max_len = 0; while (* input) {If (! Isdigit (* input) {input ++; continue;} const char * temp = input; int sum = 0; For (; isdigit (* input); input ++, sum ++); If (sum> max_len) {max_len = sum; hegin = temp ;}} memcpy (output, hegin, max_len); Output [max_len] = 0; return max_len;} int main () {char output [100]; char input [100]; while (true) {CIN> input; // After the input is complete, \ 0 memset (output, 0, sizeof (output) is automatically added at the end; int Len = continuemax (output, input ); cout <Len <"" <output <Endl;} return 0 ;}
Find the longest consecutive numeric string in the string, find the longest consecutive numeric string in the string, and return the length of the string