91 solutions

  • 0
    @ 2025-8-19 16:19:46
    #include<bits/stdc++.h>
    using namespace std;
    int st[30];
    const int N=110;
    char str[N];
    int main()
    {
        for(int i=0;i<4;i++)
        {
            cin.getline(str,N);
            int n=strlen(str);
            for(int j=0;j<n;j++)
            {
                if(str[j]>='A'&&str[j]<='Z')
                {
                    int t=str[j]-'A';
                    st[t]++;
                }
            }
        }
        int maxv=0;
        for(int i=0;i<26;i++)
        {
            maxv=max(maxv,st[i]);
        }
        for(int i=maxv;i>=1;i--)
        {
            for(int j=0;j<26;j++)
            {
                if(st[j]>=i) cout<<"* ";
                else cout<<"  ";
            }
            cout<<endl;
        }
        for(int i=0;i<26;i++)
            cout<<char('A'+i)<<" ";
        return 0;
    }
    
    
    • @ 2025-8-19 16:27:15

      孩子们这个是正数快给他冲了

Information

ID
838
Time
1000ms
Memory
256MiB
Difficulty
2
Tags
# Submissions
714
Accepted
118
Uploaded By