//Pascal
var
A: array [1..10] of byte;
i, MAX: byte;
begin
randomize;
MAX := 0;
writeln('***Исходный массив***');
for i := 1 to 10 do
begin
A[i] := random(51)+1;
if A[i] > MAX then MAX := A[i];
write(A[i]:4);
end;
writeln;
writeln('***Измененный массив***');
for i := 1 to 10 do
begin
if A[i] = MAX then A[i] := 0;
write(A[i]:4);
end;
writeln;
//readln;
end.