Курсовая работа: Создание программы для определения вершин пирамиды с выпуклым основанием по данным точкам
i:=0;
While
i<n do
begin
P.Ptr:=P.Ptr^.next;
i:=i+1;
end;
end;
end;
Procedure
ClearMem;
var
P_i,P_j:P_Points;
V_i,V_j:P_Vectors;
Begin
P_i:=P.start^.next;
V_i:=V.V_start^.next;
dispose(P.start);
dispose(V.V_start);
While
(P.Number<>0) do
begin
P.Number:=P.number-1;
P_j:=P_i;
P_i:=P_i^.next;
dispose(P_j);
end;
dispose(V_j);
end;
end;
end.
Текст
основной программы
program
FindPyramid;
uses
MyUnitVector,crt;
var
D_Vector:V_Descriptor;
D_point
:P_Descriptor;
a,b,c:Coordinates;
ch:char;
sum,sum2:real;
n1,n2:word;
begin
clrscr;
initlistOfPoint(D_point);
InitListOfVectors(D_vector);
repeat
writeln('This
programm will perform a task,which find a pyramid ');
writeln;
writeln('please,
enter "1" if you want to add point');
writeln('please,
enter "2" if you want to display all points');
writeln('please,
enter "3" if you want to find pyramid');
writeln('please,
enter "0" if you want to exit');
ch:=readkey;
Case
ch of
#49
: PutPoint(D_point);
#50
: begin
WritePoints(D_point);
readkey;
end;
#51
: begin
FinDaPyramid(D_point,mno);
readkey;
end;
end;
c lrscr;
until
ch=#48;
clearmem(D_point,D_vector);
writeln('Error=',ListError);
readkey;
end.
|