输入样例:
在这里给出一组输入。例如:
34dadee888saaaa
输出样例:
在这里给出相应的输出。例如:
34dadee888saaaa
aaaa
4
#include <iostream>
#include <string.h>
using namespace std;
/* 请在这里填写答案 */
class Str{
public:
Str(char t[]){strcpy(T,t);}
~Str(){}
void process(){
char c;
int max=1,lens=strlen(T),cnt;
for(int i=0;i<lens-1;i++){
cnt=1;
for(int j=i+1;j<lens;j++){
if(T[i]==T[j]){
cnt++;
}
else{
i=j-1;
break;
}
}
if(cnt>max){
max=cnt;
c=T[i];
}
}
cout<<T<<endl;
for(int i=0;i<max;i++){
cout<<c;
}
cout<<endl;
cout<<max;
}
void print(){
}
private:
char T[30];
};
int main()
{
char t[30];
cin>>t;
Str test(t);
test.process();
test.print();
return 0;
}