unit Unit4;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs;
type
TForm4 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
const M=3; N=6;
Type TB=Array[1..M,1..N] of real;
var
A:string[80];
B:tb;
FI:TEXTFile;
Procedure P(B:TB; M,N:Integer);
Procedure Vvod(var B:TB);
Procedure Obr(var B:TB; M,N:Integer);
implementation
uses Unit1, Unit2, Unit3;
{$R *.dfm}
Procedure P(B:TB; M,N:Integer);
var
C:char; i,j: integer;
begin
C:=chr(124);
For i:=1 to M do
begin
Write(C);
For j:=1 to N do
Case j of
1,2,4,5:Write(B[i,j]:10:4,C);
3: Write(B[i,j]:11,C);
6:Writeln(B[i,j]:12,C);
end;
Writeln(A);
end
end;
Procedure VVOD(var B:TB);
var i,j: integer;
begin
AssignFile(FI,A);
Reset(FI);
For i:=1 to 4 do
Readln(FI,A); Writeln(A);
For i:=1 to M do
For j:=1 to N do
Read(FI,B[i,j]);
P(B,M,N);
CLOSEFile(FI);
end;
Procedure OBR(var B:TB; M,N:Integer);
var i,j,i1,i2,j1,j2:integer;
MN,MX:Real;
begin
MN:=B[1,1];
MX:=B[1,1];
i1:=1; i2:=1; j1:=1; j2:=1;
For i:=1 to M do
For j:=1 to N do
if B[i,j]<MN Then Begin
MN:=B[i,j]; i1:=i;j1:=j;
end
else
if B[i,j]>MX Then Begin
MX:=B[i,j]; i2:=i;j2:=j;
end;
MN:=B[i2,j2];
MX:=B[i1,j1];
Writeln
(#10#13, 'MIN=', MN:12, 'IMIN=', i1, 'JMin=', j1, #10#13, 'MAX=', MX:12, 'IMAX=', i2, 'JMAX=', j2);
end;
end.