procedure
TForm1
.
Button1Click(Sender: TObject);
type
s=
array
[(x,y)]
of
real
;
var
H:
array
[
1..10
]
of
s;
d,max:
real
; i,j:
integer
;
begin
for
i:=
1
to
n
do
for
j:=
1
to
m
do
a[i,j]:=StrToFloat(StringGrid1
.
Cells[j-
1
,
1
]);
for
i:=
1
to
n
do
for
j:=
1
to
m
do
b[i,j]:=StrToFloat(StringGrid1
.
Cells[j-
1
,
1
]);
for
i:=
1
to
n
do
for
j:=
1
to
m
do
c[i,j]:=StrToFloat(StringGrid1
.
Cells[j-
1
,
2
]);
for
i:=
1
to
n
do
for
j:=
1
to
m
do
e[i,j]:=StrToFloat(StringGrid1
.
Cells[j-
1
,
2
]);
for
j:=
1
to
m
do
d:=
0
;
d:=sqrt(sqr(a[i,j]-b[i,j])+sqr(c[i,j]-e[i,j]));
for
i:=
1
to
n
do
begin
max:=
0
;
for
j:=
1
to
m
do
if
d>max
then
max:=d;
end
;
ShowMessage(
'расстояние='
+FloatToStr(max));
end
;
end
.