#include<iostream> using namespace std; int continumax(char *outputstr,char *inputstr) { int length=0,max=0;char *tempstr=inputstr;//C风格字符串需要分配内存 while(*inputstr) { if(*inputstr>'9'||*inputstr<'0') { length=0;inputstr++; } if(*inputstr<='9'&&*inputstr>='0') { tempstr[length]=*inputstr++; length=length+1; } if(length>max) { max=length; } } outputstr=tempstr; outputstr[max]='\0'; return max; } int main() { char inputstr[100],*outputstr; while(cin>>inputstr) { outputstr=inputstr;//C风格字符串需要分配内存 cout<<continumax(outputstr,inputstr)<<' '<<outputstr<<endl; } return 0; }