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)
12-14
1014
1014
09-28
297
297

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



