Const
n = 1000;
var
massiv : array[1..n] of integer;
countOfElements, maxElement, i, m, j : integer;
begin
write('Введите количество элементов массива: '); readln(countOfElements);
writeln('Введите элементы массива');
for i := 1 to countOfElements do
read(massiv[i]);
writeln();
maxElement := massiv[1];
for i := 1 to countOfElements do
if (maxElement < massiv[i]) then maxElement := massiv[i];
m := countOfElements;
i := 1;
while i <= m do <br> if massiv[i] = maxElement then
begin
for j := i to countOfElements - 1 do
massiv[j] := massiv[j+1];
m := m - 1;
end
else
i := i + 1;
massiv[countOfElements] := 0;
write('Максимальный элемент: '); writeln(maxElement);
for i := 1 to countOfElements do
write(massiv[i]:4);
end.