#include <iostream>
#include<map>
#include<string>
using namespace std;
int main() {
    string s;
    cin>>s;
    map<char,int> m;
    for(int i=0;i<s.length();i++){
        m[s[i]]++;
    }
    for(auto i:m){
        cout<<i.first<<" "<<i.second<<"\n";
    }
    char c;
    int max=-1;
    for(auto i:m){
        if(i.second>max){
            max=i.second;
            c=i.first;
        }
    }
    cout<<"most repeating character is : '"<<c<<"' repeated for "<<max<<" times\n";
    return 0;
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: