明明末尾一点空格都没有啊
#include <bits/stdc++.h>
using namespace std;
string s;
map<char,int> mapp;
int maxn=0;
int main()
{
ios::sync_with_stdio(false);
for(int i=1;i<=4;i++)
{
getline(cin,s);
for(const char ch : s)
{
if (!isalpha(ch)) {
continue;
}
if (mapp.find(ch) == mapp.end()) {
mapp[ch] = 1;
}
else {
mapp[ch]++;
}
}
}
for(auto it=mapp.begin();it!=mapp.end();it++)
{
maxn=max(maxn,it->second);
}
for(int i=1;i<maxn;i++)
{
for(int j=1;j<=25;j++)
{
if(maxn-i>mapp['A' + j - 1])
cout<<" ";
else
cout<<"* ";
}
if(maxn-i>mapp['A'+25])
cout<<" ";
else
cout<<"*";
cout<<endl;
}
for(int i=0;i<=24;i++)
cout<<(char)('A'+i)<<" ";
cout<<"Z";
return 0;
}