80pts,help
查看原帖
80pts,help
877497
JFY_2208楼主2023/5/27 21:14
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long int n,s=1,max=0;
    cin>>n;
    int a[n];
    for(int i=0; i<n; i++)
    {
        cin>>a[i];
        if(i==0)
            continue;
        if(a[i]-1==a[i-1])
            s++;
        else
        {
            if(s>max)
                max=s;
            s=1;
        }
    }
    cout<<max<<endl;
    return 0;
}

?????

2023/5/27 21:14
加载中...