同一份代码 本地AC,评测机CE,在线IDE OLE。
bdfs无果,求助。
#include<bits/stdc++.h>
using namespace std;
int main(){
int a[27];
char c[10001];
int maxn=0;
for(int i=0;i<4;i++){
gets(c);
for(int j=0;j<strlen(c);j++){
if(isupper(c[i])){
a[c[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<25;j++){
if(a[j]==i){
cout<<'*';
a[j]--;
}
else cout<<' ';
cout<<' ';
}
if(a[25]==i){
cout<<'*';
a[25]--;
}
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;
}