#include <iostream>
using namespace std;
int continumax(char *out,char *in) {
char* tempHead = NULL;
char* head = NULL;
int tempMax = 0;
int max = 0;
char* cur;
cur = in;
while(*cur != '\0'){
while(*cur > '9' || *cur < '0')
cur ++;
if(*cur == '\0') {
break;
}
tempHead = cur;
while(*cur <= '9' && *cur >= '0') {
tempMax ++;
cur++;
}
if(tempMax > max) {
max = tempMax;
head = tempHead;
}
tempMax = 0;
if(*cur == '\0') {
break;
}
}
for(int i = 0; i<max;i++) {
out[i] = head[i];
}
out[max] = '\0';
return max;
}
int main()
{
char s[] = "abcd12ed125ss123as34534df";
char out[20];
continumax(out,s);
cout<<out;
}
using namespace std;
int continumax(char *out,char *in) {
char* tempHead = NULL;
char* head = NULL;
int tempMax = 0;
int max = 0;
char* cur;
cur = in;
while(*cur != '\0'){
while(*cur > '9' || *cur < '0')
cur ++;
if(*cur == '\0') {
break;
}
tempHead = cur;
while(*cur <= '9' && *cur >= '0') {
tempMax ++;
cur++;
}
if(tempMax > max) {
max = tempMax;
head = tempHead;
}
tempMax = 0;
if(*cur == '\0') {
break;
}
}
for(int i = 0; i<max;i++) {
out[i] = head[i];
}
out[max] = '\0';
return max;
}
int main()
{
char s[] = "abcd12ed125ss123as34534df";
char out[20];
continumax(out,s);
cout<<out;
}