全部RE的蒟蒻求助
查看原帖
全部RE的蒟蒻求助
1416591
sunhewei楼主2024/10/3 10:24
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	int a[26]={0},maxn=0;
	for(int i=0;i<4;i++){
		getline(cin,s);
		for(int j=0;j<s.length();j++){
			if(s[j]>='A'&&'Z'>=s[j]){
				a[s[j]-'A']++;
				if(a[s[j]-'A']>maxn){
					maxn=a[s[j]-'A'];
				}
			}
		}
	}
	for(int i=maxn;i>0;i--){
		for(int j=0;j<=26;j++){
			if(a[j]!=i){
				cout<<' ';
			}
			else{
				cout<<'*';
				a[j]--;
			}
			if(j==26){
				cout<<endl;
			}
		}
	}
	char fex='A';
	for(int i=0;i<26;i++){
		cout<<fex;
		fex+=1;
	}
	return 0;
}
2024/10/3 10:24
加载中...