1042 字符统计 (20 分)

水~。

map<char,int> mp;

int main()
{
    string s;
    getline(cin,s);

    for(auto t:s)
        if(isalpha(t))
            mp[tolower(t)]++;

    char c='a';
    for(auto t:mp)
        if(t.se > mp[c])
            c=t.fi;

    cout<<c<<' '<<mp[c]<<endl;
    //system("pause");
    return 0;
}
posted @ 2021-02-17 19:24  Dazzling!  阅读(22)  评论(0编辑  收藏  举报