program reshenie; var i,n:integer; a:array [1..1000] of real; begin randomize; writeln('vvedite razmer massiva'); readln(n); for i:=1 to n do begin a[i]:=random(100)+1; write(a[i]:4:2,' '); end; writeln; a[1]:=(a[1]+a[2])/2; for i:=2 to n-1 do a[i]:=(a[i]+a[i-1]+a[i+1])/3; a[n]:=(a[n]+a[n-1])/2; for i:=1 to n do write(a[i]:4:2,' '); readln; end.
for i:=1 to n do begin a[i]:=random(100)+1; write(a[i]:4:2,' '); end; writeln; a[1]:=(a[1]+a[2])/2; for i:=2 to n-1 do a[i]:=(a[i]+a[i-1]+a[i+1])/3; a[n]:=(a[n]+a[n-1])/2; for i:=1 to n do write(a[i]:4:2,' ');