eolymp
bolt
Try our new interface for solving problems
dərc olunub 05.12.22 17:19:52

//

dərc olunub 22.02.24 17:40:24

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;

}