这条代码怎么会错
查看原帖
这条代码怎么会错
857173
SandWave2023楼主2023/5/7 12:33

rt

#include<bits/stdc++.h>
using namespace std;
long long t,t_1,n,temp,maxn;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	cin>>t;
	while(t--)
	{
		cin>>t_1;
		maxn=0;
		temp=0;
		for(int i=1;i<=t_1;i++)
		{
			cin>>n;
			if(n==1&&temp>maxn)
			{
				maxn=temp;
				temp=0;
			}
			if(n==0)temp++;
			//t_1--;
		}
		if(temp>maxn)maxn=temp;
		cout<<maxn<<"\n";
	}
	return 0;
}
2023/5/7 12:33
加载中...