注意!
查看原帖
注意!
1085259
codingguest楼主2024/9/17 20:20

如果有像我这样写的:

#include<bits/stdc++.h>
using namespace std;
char a[50][73];
int f[100];
int ans=0;
int main()
{
	for(int i=1;i<=4;i++)
	{
		getline(a[i]+1);
		int n=strlen(a[i]+1);
		for(int j=1;j<=n;j++)
		{
			f[a[i][j]-'A']++;
		}
	}
	for(int i='A';i<='Z';i++)
	{
		if(f[i-'A']>ans) ans=f[i-'A'];
	}
	for(int i=ans;i>=1;i--)
	{
		for(int j='A';j<='Z';j++)
		{
			if(f[j-'A']>=i) cout<<"*";
			else cout<<" ";
			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;
}

直接交只能拿60分,#2与#3都RE了
为什么?
(纯氧中毒)关O2优化即可
我也不知道为啥

2024/9/17 20:20
加载中...