Const
N = 3;
M = 4;
Var
A:array[1..N,1..M] of real;
i,j:integer;
Sr,B,C:real;
Begin
Randomize;
WriteLn('Исходная матрица:');
For i:= 1 to N do
Begin
For j:= 1 to M do
Begin
A[i,j]:=random()*13;
Write(A[i,j]:6:3,' ')
End;
WriteLn;
End;
WriteLn;
WriteLn('Сглаженная матрица:');
For i:= 1 to N do
Begin
B:=A[i,1];
C:=A[i,2];
A[i,1]:=(B+C)/2;
For j:= 2 to M-1 do
Begin
Sr:=(B+C+A[i,j+1])/3;
B:=A[i,j];
A[i,j]:=Sr;
End;
A[i,M]:=(B+A[i,M])/2
End;
For i:= 1 to N do
Begin
For j:= 1 to M do
Write(A[i,j]:6:3,' ');
WriteLn;
End
End.