CPP没有执行!!
查看原帖
CPP没有执行!!
654928
Zjc20120331楼主2022/1/18 16:12
#include <bits/stdc++.h>

using namespace std;

int main()
{
	int a[1005], i, x = 0, y = 0, max;
	short n;
	
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> a[n];
	}
	
	for (i = 1; i <= n-1; i++)
	{
		while (a[i]+1 == a[i+1])
		{
			//cout << "执行";
			y++;
			if (y > x)
			{
				x = y;
			}
		}
	}
	
	cout << x;
	
	return 0;
}
2022/1/18 16:12
加载中...