0分求调QAQ
查看原帖
0分求调QAQ
1375162
MasterBait楼主2024/6/26 22:46
#include<bits/stdc++.h>
using namespace std;
int main(){
	char a[402][28]={' '};
	for(int i=0;i<=25;i++){
		a[0][i]=65+i;
	}
	int l[26]={0};
	string s;
	for(int i=1;i<=4;i++){
		getline(cin,s);
		for(int j=0;j<s.size();j++){
			if(s[j]>='A'&&s[j]<='Z'){
				l[(s[j]-65)]++;			
			}
		}
	} 
	for(int i=0;i<26;i++){
		for(int j=1;j<=l[i];j++){
			a[j][i]='*';
		}
	}
	sort(l,l+26);
	int h=l[25];
	for(int i=h;i>=0;i--){
		for(int j=0;j<=25;j++){
			cout<<a[i][j];
			if(j<25){
				cout<<" ";
			}
		}
		if(i!=0) cout<<endl;
	}
	return 0;
}
2024/6/26 22:46
加载中...