program EXAM14;

{\$APPTYPE CONSOLE}

uses
SysUtils;

type matr=array[1..30,1..20]of integer;
mas=array[1..10] of real;
y=file of real;
var
ff:y;
a:matr;
b,c:mas;
i,j,m,n,f,l,k:integer;
sr:real;
procedure s(a:matr; m,n:integer;var b:mas);
var s:real;
begin
k:=0;
for j:=1 to n do begin
s:=0 ;
for i:=1 to m do s:=s+a[i,j];
sr:=s/n;b[j]:=sr;
end;
end;

Begin
repeat
writeln('Vvedite razmernost');
until (m<10) and (n<10);
writeln('Vvedite elementi:');
for i:=1 to m do
for j:=1 to n do
writeln('Vveli:');
for i:=1 to m do begin
for j:=1 to n do write(a[i,j]:4);
writeln;
end;
writeln;
writeln('*************************');
s(a,m,n,c);
For j:=1 to n do write(c[j]:4);
writeln;
writeln('*************************');
writeln;
repeat
writeln('Vvedite razmernost');
until (m<10) and (n<10);
writeln('Vvedite elementi:');
for i:=1 to f do
for j:=1 to l do
writeln('Vveli:');
for i:=1 to f do begin
for j:=1 to l do write(a[i,j]:4);
writeln;
end;
writeln;
s(a,f,l,b);
writeln;
assign(ff,'c:\f1.dat');
rewrite(ff);
for i:=1 to m do
write(ff,b[i]);
close(ff);
writeln('FAIL:');
reset(ff);
While not eof(ff) do begin
write(b[1]:4);
end;
close(ff);