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
763
09-28
132
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交