#include<iostream> using namespace std; int main() { int n,a,b,max=0,cot=1; cin>>n>>a; for(int i=1; i<=n-1; i++) { cin>>b; if(a+1==b) { cot++; if(max<cot) { max=cot; } } else { cot=1; } a=b; } cout<<max; return 0; }
为什么只有80分
它输入了一百个1,我输出1有问题吗?