eolymp
bolt
Try our new interface for solving problems
published at 12/5/22, 5:19:52 pm

//

published at 2/22/24, 5:40:24 pm

include <bits/stdc++.h>

using namespace std; int main() {

string a; 
getline(cin, a);
int maxi=0;
int s[256]={0};
for (int i=0; i<a.size(); i++)
{
    s[a[i]]++;
}
for (int i=0; i<256; i++)
{
    if(s[i]>maxi) 
    maxi=s[i];
}
cout<<maxi<<endl;
for (int i=0; i<a.size(); i++)
{
    if(s[a[i]]==maxi)
    {
    cout<<a[i]<<' '; 
    s[a[i]]=0;
    }
}
return 0;

}