求教
查看原帖
求教
1073167
HuangZihan181楼主2024/9/1 14:39
#include<bits/stdc++.h>
using namespace std;
int N,KC[1000000],MAX_t;
int main(){
	cin>>N;
	for(int k=0;k<N;k++){
		cin>>KC[k];
	}
	int t=0;
	for(int k=0;k<N;k++){
		if(k==0||KC[k]>KC[k-1]){
			t++;
		}else if(MAX_t<t){
			MAX_t=t;
			t=0;	
		}else{
			t=0;
		}
	}
	if(MAX_t<t){
		MAX_t=t;	
	}
	cout<<MAX_t; 
    return 0;
}
2024/9/1 14:39
加载中...