program FindElements; const n = 10; var arr: array[1..n] of integer; i: integer; begin writeln('Enter ', n, ' integer elements:'); for i := 1 to n do readln(arr[i]);
writeln('Elements that have smaller values on the left and on the right:'); for i := 2 to n - 1 do begin if (arr[i] < arr[i-1]) and (arr[i] < arr[i+1]) then writeln(arr[i]); end; end.
program FindElements;
const
n = 10;
var
arr: array[1..n] of integer;
i: integer;
begin
writeln('Enter ', n, ' integer elements:');
for i := 1 to n do
readln(arr[i]);
writeln('Elements that have smaller values on the left and on the right:');
for i := 2 to n - 1 do
begin
if (arr[i] < arr[i-1]) and (arr[i] < arr[i+1]) then
writeln(arr[i]);
end;
end.