注意到了行末不输出空格,但还是G了
#include<bits/stdc++.h>
using namespace std;
int a[27];
char s[102];
int main(){
int maxn=0,n=0;
for(int i=0;i<4;i++)
{ gets(s);
n=strlen(s);
for(int j=0;j<n;j++)
if(s[j]>='A'&&s[j]<='Z')a[s[j]-'A']++;
}
for(int i=0;i<26;i++)maxn=max(maxn,a[i]);
for(int i=maxn;i>0;i--)
{
for(int j=0;j<26;j++)
{
if(j=25)
{
if(a[j]==i)
{
cout<<"*";
a[j]--;
}
else cout<<" ";
}
if(j<25){
if(a[j]==i)
{
cout<<"* ";
a[j]--;
}
else cout<<" ";
}
}
cout<<endl;
}
for(int k=0;k<26;k++)printf("%c ",k+'A');
return 0;
}