P1958为什么错了??
#include<bits/stdc++.h>
using namespace std;
string s;
int maxl=-1,a[30];
int main()
{
for(int i=1;i<=4;i++){
cin>>s;
getline(cin,s);
for(int j=1;j<=s.size();j++){
if(s[j]>='A'&&s[j]<='Z')
a[s[j]-'A']++;
}
}
for(int i=1;i<=26;i++)
maxl=max(a[i],maxl);
for(int i=maxl;i>=0;i--)
{
for(int j='A';j<='Z';j++){
if(a[j-'A']>i) cout<<"*";
else cout<<" ";
cout<<" ";
}
cout<<endl;
}
cout<<"A B C D E F G H I J K L M N O P Q R S T U V W X Y Z";
return 0;
}
输出少两行◑﹏◐