Спасибо большое=)
PHP код:
Unit My_Unit;
Interface
Const
n=5;
Type
mass = array[1..n] of real;
Coord=Record
x,y:mass;
End;
Function First_Quadr(i:integer; z:Coord):boolean;
Implementation
Function First_Quadr(i:integer; z:Coord):boolean;
begin
if (z.x[i]>=0) and (z.y[i]>=0) then
First_Quadr:=true
else
First_Quadr:=false;
end;
end.
PHP код:
Uses My_Unit;
Const
x:mass=(2, -3, 6, 7, 8);
y:mass=(0, 1, -2,9, 3);
Var
i:byte;
b:boolean;
Point:Coord;
R:real;
Begin
Point.x:=x;
Point.y:=y;
R:=0;
b:=true;
for i:=1 to n do
if not First_Quadr(i, Point) then
begin
b:=false;
end;
if not b then
begin
writeln('Координаты точек, не попавших в 1 квадрант: ');
for i:=1 to n do
if not First_Quadr(i, Point) then
writeln('x = ',Point.x[i]:0:3,' y = ',Point.y[i]:0:3);
end
else
begin
for i:=1 to n do
if Sqrt(Sqr(Point.x[i])+Sqr(Point.y[i]))>R then
R:=Sqrt(Sqr(Point.x[i])+Sqr(Point.y[i]));
end;
if b then
begin
writeln('Все точки принадлежат 1 квадранту. ');
writeln('Rmax = ',R:0:3);
end;
End.