#include
#include
#include
using namespace std;
void frequency(string s)
{
pair<char,int>f[1000];
int i=0;
for(; i<1000 ; i++)
{
f[i]=make_pair(β\0β,0);
}
i=0;
f[0].first=*s.begin();
f[0].second=0;
for(auto c : s)
{
if(*c==f[i])
{
f[i].second++;
}
else
{
i++;
f[i].first=*c;
f[i].second++;
}
}
pair<int , int >p;
p.first=0;
for(int j=0 ; j<i+1 ; j++)
{
if(p.first<f[j].second)
p.second=j;
}
cout<<f[p.second].first;
}//end
int main()
{
string s;
getline(cin,s);
sort(s.begin(), s.end());
cout << s;
frequency(s);
return 0;
}
//ERRORS: source.cpp: In function βvoid frequency(std::string)β:
source.cpp:21:7: error: invalid type argument of unary β*β (have βcharβ)
21 | if(c==f[i])
| ^
source.cpp:28:16: error: invalid type argument of unary 'β (have βcharβ)
28 | f[i].first=*c;
| ^