听灌多
  • 板块灌水区
  • 楼主_you_know_who_
  • 当前回复11
  • 已保存回复11
  • 发布时间2024/8/10 10:58
  • 上次更新2024/8/10 11:41:34
查看原帖
听灌多
1339644
_you_know_who_楼主2024/8/10 10:58

我脑子坏掉了,编译错误,老是找不到原因,哪个大佬能帮我看看/(ㄒoㄒ)/~~

#include<bits/stdc++.h>
using namespace std;
int mx;
int ans[101];
string a[101],b;
int main()
{
	int t;
	cin>>t;
	for(int pp=1;pp<=t;pp++)
	{
		ans[pp]=0;
		cin>>a[pp]>>b;
		int n=b.size();
		b=b+"@@@@@@@@@@@";
		for(int i=0;i<n;i++)
		{
			string k=b[i]+b[i+1]+b[i+2];
            cout<<k<<'\n';
			if(k=="sos")
			{
				ans[pp]++;
			}
		}
		mx=max(mx,ans[pp]);
	}
	for(int i=1;i<=t;i++)
	{
		if(ans[i]==mx)
		{
			cout<<a[i]<<' ';
		}
	}
	cout<<mx<<endl;
	return 0;
}

2024/8/10 10:58
加载中...