#include
#include
using namespace std;
int main()
{
char a[1000];
cin >> a;
char b[1000];
int length = 0;
int i;
for ( i = 0; i < strlen(a); i++) // aaaabacd
{ int count = 0;
for (int j = 1; j < strlen(a); j++)
{
if (a[i] == a[j])
{
count++;
}
}
if (length <= count)
{
length = count;
b[i]= a[i];
}
}
cout << length+1;
cout<<b[i];
return 0;
}
i have made this code in which t would tell me maximum number of time charchter have occured but why it is not telling that charchter that occured maximum number of time