1 solutions

  • 0
    @ 2025-7-9 9:11:11

    #include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; int max=0; int j=0; int cnt[123]={0}; for(int i=0;i<s.size();i++) { cnt[s[i]-97]++; } for(int i=0;i<123;i++) { if(cnt[i]>max) { max=cnt[i]; j=i; } } cout<<char(j+97)<<" "<<cnt[j]; return 0; }

    Information

    ID
    1107
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    10
    Tags
    # Submissions
    1
    Accepted
    1
    Uploaded By