1 条题解

  • 0
    @ 2026-10-2 2:21:37

    C++ :

    #include<iostream>
    #include<cstdio>
    #include<cstring>
    using namespace std;
    char str[1100];
    int main()
    {
        int a[30]={0};
        int len,max=-1;
        int i,j;
    
        cin>>str;
        len=strlen(str);
        for(i=0;i<len;i++)
            a[str[i]-'a']++;
    
        for(i=0;i<26;i++)
            if(a[i]>max)
            {
                j=i;
                max=a[i];
            }
    
        cout<<char('a'+j)<<" "<<max<<endl;
        return 0;
    }
    
    • 1

    信息

    ID
    3863
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者