像这样:
```cpp
int maxx=0;
for(int i=0;i<26;i++) maxx=max(maxx,ch[i]);
for(int j=maxx;j>=1;j--){
for(int i=0;i<26;i++){
if(ch[i]>=j) printf("* ");
else printf(" ");
}putchar('\n');
}
for(int i=0;i<26;i++) printf("%c ",i+'A');
```
by Root808 @ 2023-08-05 10:15:26
```cpp
#include<bits/stdc++.h>
#define _ for(int i=1;i<=n;i++)
using namespace std;
string s[4];
int a[27],maxn=-1;
int main(){
getline(cin,s[0]);getline(cin,s[1]);getline(cin,s[2]);getline(cin,s[3]);
for(int i=0;i<=3;i++)for(int j=0;j<s[i].length();j++)if(s[i][j]-64>=1&&s[i][j]-64<=26)a[s[i][j]-64]++;
for(int i=1;i<=26;i++)if(a[i]>maxn)maxn=a[i];
for(int i=maxn;i>=1;i--){
for(int j=1;j<=26;j++)
if(a[j]>=i)cout<<"* ";else 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;
}
```
by zy_nb @ 2023-08-05 10:16:45
@[wangzr666666](/user/983244)
```cpp
#include <bits/stdc++.h>
using namespace std;
string s;
int maxx;
int t[256];
int main(){
while (getline(cin,s)){
for (int i=0;i<s.size();i++){
if (isupper(s[i])){
t[s[i]]++;
maxx=max(maxx,t[s[i]]);
}
}
}
for (int j=maxx;j;j--){//遍历“柱”的高度
for (char i='A';i<='Z';i++){
if (t[i]>=j){//如果该字母的出现次数大于当前高度,就输出一个*
cout<<"* ";
}else{
cout<<" ";
}
}
cout<<endl;
}
for (char i='A';i<='Z';i++){
cout<<i<<" ";
}
return 0;
}
```
by CSP_juruo @ 2023-08-05 10:19:24
OKOK,谢谢你们
by wangzr666666 @ 2023-08-05 10:54:58
```cpp#include <bits/stdc++.h>
using namespace std;
int f[26];
int main() {
string a, s1, s2, s3, s4;
int maxn = 0;
getline(cin, s1);
getline(cin, s2);
getline(cin, s3);
getline(cin, s4);
a = s1 + s2 + s3 + s4;
for (int i = 0; i <= a.size(); i++) {
if (a[i] >= 'A' && a[i] <= 'Z') {
f[a[i] - 'A']++;
}
}
for (int i = 0; i < 26; i++) {
maxn = max(maxn, f[i]);
}
for (int i = maxn; i > 0; i--) {
for (int j = 0; j < 26; j++) {
if (i <= f[j]) {
cout << "* ";
} else {
cout << " ";
}
}
cout << endl;
}
for (int i = 0; i < 26; i++) {
printf("%c ", i + 'A');
}
return 0;
}
```
by Guagua111 @ 2023-08-21 08:51:00