Function Prototypes:
Unsignedint Continumax (char** poutputstr, char* intputstr)
Input parameters:
char* intputstr input string;
Output parameters:
char** Poutputstr: The longest consecutive number string, if the length of the longest serial number string is 0, should return an empty string; If the input string is empty, you should return an empty string;
Here is the code that you implemented
#include <stdio.h> #include <Windows.h> #include <ctype.h> int Countmax (char *outputstr, char*
INTPUTSTR) {Char *in = intputstr, *out = Outputstr, *temp, *final;
int count = 0, maxlen = 0; while (*in!= ' ") {if (*in >= ' 0 ' &&*in <= ' 9 ') {for (temp = in; *in > = ' 0 ' && *in <= ' 9 ';
in++) {count++;
printf ("*in:%c", *in);
printf ("Count%d\n", count);
} else {in++;
Count = 0;
} if (MaxLen < count) {MaxLen = count;
Count = 0;
final = temp;;
for (int i = 0; i < MaxLen; i++) {*out = *final;
out++;
final++;
} *out = ' I ';
return maxlen;
int main () {char *in = ' as2132asd54sa10322 ';
Char out[100];
int Len;
Len = Countmax (out,in); Printf("%d%s", len,out);
System ("pause");
return 0; }