1.连续6个点递增或递减
//传入数据列表
//返回连续X个及以上递增或递减的数组下标
int n = array.Length;
int X = X_in;
List<int> regions_start = new List<int>();
List<int> regions_end = new List<int>();
if(Open){
for (int i = 0; i < n - (X - 1); i++) // 从第一个元素开始遍历,最多遍历到倒数第6个元素,确保后面能有连续6个元素可判断
{
bool increasing = true;
for (int k = i; k < i + (X - 1); k++)
{
if (array[k] >= array[k + 1])
{
increasing = false;
break;
}
}
bool decreasing = true;
for (int m = i; m < i + (X - 1); m++)
{
if (array[m] <= array[m + 1])
{
decreasing = false;
break;
}
}
if (increasing