void 奇怪的风吹()
{//缘由https://ask.csdn.net/questions/1062454
int aa[]{15, 30, 12, 36, 11, 20, 19, 17, 16, 18, 38, 15, 30, 12, 36, 11, 20, 19, 17, 16, 18, 38, -1},
j = 0, a = 0, y = 0, z = 0;
while (aa[j] > 0)
{
if (j && aa[j] > 35 || aa[j] < 15)//当下标大于0且数据按题目要求的值
{//检查找到的数据前面一个数据是否满足题目要求的条件,且计数清零。
if ((aa[j - 1] > 35 && aa[j - 1] > aa[j]) || (aa[j - 1] < 15 && aa[j - 1] < aa[j]))++a;
z = 0;
}
else
{//连续计数符合条件进行计数并清零为下次计数
if (a && aa[j] >= 15 && aa[j] <= 35 && ++z >= 3)++y, z = 0;
}
++j;
}
cout << a << ends << (a - y) << endl;
}