AI正在回答,请等待......
#include <iostream>
#include <fstream>
using namespace std;
int main(){
ifstream fin("input.txt");
int cnt[26] = {0};
char c;
while(fin >> c){
cnt[c-'A']++;
}
int max = 0;
for(int i=0; i<26; i++){
if(cnt[i] > max){
max = cnt[i];
}
}
for(int i=max; i>=1; i--){
for(int j=0; j<26; j++){
if(cnt[j] >= i){
cout << "* ";
}else{
cout << " ";
}
}
cout << endl;
}
for(int i=0; i<26; i++){
cout << (char)(i+'A') << " ";
}
cout << endl;
return 0;
}
谁帮我看看,CHATgpt 打的什么......