Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program Task_6;
- Var
- a : array [1..10000] of integer;
- i,n, sum: integer;
- check : boolean;
- Begin
- sum:=0;
- read(n);
- check:=false;
- for i := 1 to n do
- read(a[i]);
- for i := 2 to n-1 do
- begin
- if ((a[i-1] < a[i]) and (a[i] > a[i+1])) then
- sum := sum +1;
- end;
- write(sum);
- End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement