蒟蒻在线蹲大佬
查看原帖
蒟蒻在线蹲大佬
527003
谕恋CE楼主2022/1/22 08:18
#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有问题吗?

2022/1/22 08:18
加载中...