Var
i,sum,max:integer;
K: array [1..37] of integer;
begin
writeln('Введите массив');
for i:=1 to 37 do
read(K[i]);
sum:=0;
max:=0;
for i:=1 to 37 do begin
if maxmax:=K[i];
end;
for i:=1 to 37 do begin
if (K[i]>9) and (K[i] mod 3=0) then begin
sum:=sum+K[i];
K[i]:=max;
end;
end;
writeln('сумма = ',sum);
writeln('Новый массив');
for i:=1 to 37 do begin
write(K[i],' ');
end;
end.