n = int(input())
list1 = list(map(int,input().split()))
num = 0
for i in range(1, n-1):
if (list1[i-1] > list1[i] and (list1[i+1] > list1[i])) or\
(list1[i-1] < list1[i] and (list1[i+1] < list1[i])):
num = num + 1
print(num)
CCF python 折点计数
最新推荐文章于 2025-02-26 20:03:05 发布
444

被折叠的 条评论
为什么被折叠?



