Решение на Free Pascal IDE 2.6.0
var s:array[1..15] of integer; k,max,arf:integer;
begin max:=0;
for k:=1 to 15 do
read(s[k]);
for k:=1 to 5 do
if s[k]>max then max:=s[k];
for k:=7 to 15 do
arf:=arf+k;
arf:=round(arf/9);
for k:=1 to 15 do
if s[k]>arf then s[k]:=max;
for k:=1 to 15 do
writeln('s[',k,']= ',s[k]);
Writeln('Srednee arifmeticheskoe = ',arf);
writeln('Max = ',max);
readln; readln;
end.C