蒟蒻代码求调
查看原帖
蒟蒻代码求调
970788
YAZ_Leo楼主2024/6/17 13:27
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,a[100010],s=0,maxx=-1000;
	cin>>n;
	for(int i=1;i<=n;i++)cin>>a[i];
	for(int i=1;i<n;i++)
	{
		if(a[i]<a[i+1])s++;
		else
		{
			if(maxx<s)maxx=s;
			s=1;
		}
	}
	if(a[n-1]>a[n])maxx=s+1;
	cout<<maxx;
	return 0;
} 
2024/6/17 13:27
加载中...