救助,为什么编译失败?
查看原帖
救助,为什么编译失败?
1328917
WJF891210楼主2024/9/8 17:09
#include<bits/stdc++.h>
using namespace std;
int f[30],len,maxi;
char a[100];
int main(){
	for(int i = 1;i <= 4;i++){
		gets(a);
		len = strlen(a);
		for(int j = 0;j < n;j++)
			if('A'<=a[j] && a[j]<='Z')
				f[a[j] - 'A']++;
	}
	for(int i = 0;i < 26;i++)
		maxi = max(maxi,f[i]);
	for(int i = maxi;i > 0;i--){
		for(int j = 0;j < 26;j++){
			if(f[j] >= i) cout << "* ";
			else cout << "  ";
		}
		puts("");
	}
	for(int i = 0;i < 26;i++)
		printf("%c ",i + 'A');
	return 0;
}
2024/9/8 17:09
加载中...