vasssiliy
Новичок
|
program files; const nmax=10; mmax=15; type tmatr=array[1..nmax,1..mmax] of real; tfile=file of real; var f:tfile; n,m:byte; c,a:tmatr; s:real; procedure vvodmatr(var a:tmatr;var n,m:byte;ch:char); var i,j:byte; begin writeln('ввод матрицы' ); write('n='); readln(n); write('m='); readln(m); for i:=1 to n do for j:=1 to m do begin write(ch,'[',i,',',j,']=' ); readln(a[i,j]); end; end; procedure formfile(const a:tmatr;n,m:byte; var h:tfile); var i,j:byte; b,mn:real; begin rewrite(h); for j:=1 to m do begin mn:=a[1,j]; for i:=1 to n do if a[i,j]<mn then mn:=a[i,j]; write(mn,' '); write(h,mn); end; close(h); end; procedure vyvod(var h:tfile; ch:string); var a:real; begin reset(h); if filesize(h)>0 then begin while not eof (h) do begin read(h,a); write(a:6:2); end; writeln; end; close(h); end; begin assign(f,',база1.txt'); vvodmatr(c,n,m,'c'); vyvod(f,'f'); end.
|