0pts求调
查看原帖
0pts求调
745329
Masked_fool楼主2024/10/25 14:14
#include <bits/stdc++.h>
#define int long long
using namespace std;
int a[30];
int maxn = 0;
signed main() {
	int T = 4;
	while (T --) {
		string s;
		getline(cin, s);
		int l = s.length();
		for (int i = 0; i < l; i ++) {
			if (s[i] < 'A' or s[i] > 'Z') continue;
			a[s[i] - 'A' + 1] ++;
			maxn = max(maxn, a[s[i] - 'A' + 1]);
		}
	}
	int now = 0;
	while (maxn --) {
		now ++;
		for (int i = 1; i <= 26; i ++) {
			a[i] --;
			if (a[i] + now <= maxn) {
				cout << ' '; 
			}
			else cout << '*';
			if (i != 26) cout << ' ';
		}
		cout << '\n';
	}
	for (char c = 'A'; c <= 'Z'; c ++) cout << c << " "[c != 'Z'];
	
	return 0;
} 
2024/10/25 14:14
加载中...