program mas_el_rav_srznach_2sledzanim;
const n=2015;
var
a:array[1..n] of integer;
i,k:integer;
begin
writeln(' Заполняем массив...');
for i:=1 to n do
begin
a[i]:=random(100);
write(' ',a[i]:5);
end;
writeln;
k:=0;
writeln(' Ищем...');
for i:=1 to n-2 do
begin
if(a[i]=(a[i+1]+a[i+2])/2) then
begin
writeln(k+1:4,')',i:5,' ',a[i]:3,'=(',a[i+1]:3,' +',a[i+2]:3,')/2');
inc(k)
end
end;
write(' Нашли 》');
write(k)
end.