理解题目
连续
#include<bits/stdc++.h>
using namespace std;
int main()
{
int N;
cin>>N;
int a[N];
for(int i=0;i<N;i++) cin>>a[i];
int d,s=0,t;//s第一项,t第二项 ,d公差值
int ans=1;
while(s<N-1)
{
t=s+1;
d=a[t]-a[s];
while(t<N && a[t]-a[t-1]==d)t++;
t--;
if(ans<t-s+1)ans=t-s+1;
s=t;
}
cout<<ans;
}