Program qfdw;uses crt;Type vershina=Record Tochka:string; X,Y:real; end; ps=File of vershina;Var f:ps; z,a,b,c:vershina; i:integer;Begin assign(f,'1.dat'); rewrite(f); writeln('Введите вершины треугольника и их координаты: '); for i:=1 to 3 do begin writeln(i,'-я вершина'); write('буква: ');read(z.tochka); write('X=');read(z.x); write('Y=');read(z.y); write(f,z); end; Close(f); assign(f,'1.dat'); reset(f); read(f,a); read(f,b); read(f,c); close(f); writeln('Cтороны треугольника:'); writeln(a.tochka,b.tochka,' = ',sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)):5:2); writeln(c.tochka,b.tochka,' = ',sqrt((c.x-b.x)*(c.x-b.x)+(c.y-b.y)*(c.y-b.y)):5:2); writeln(a.tochka,c.tochka,' = ',sqrt((a.x-c.x)*(a.x-c.x)+(a.y-c.y)*(a.y-c.y)):5:2);end.
Program qfdw;
uses crt;
Type
vershina=Record
Tochka:string;
X,Y:real;
end;
ps=File of vershina;
Var f:ps;
z,a,b,c:vershina;
i:integer;
Begin
assign(f,'1.dat');
rewrite(f);
writeln('Введите вершины треугольника и их координаты: ');
for i:=1 to 3 do
begin
writeln(i,'-я вершина');
write('буква: ');read(z.tochka);
write('X=');read(z.x);
write('Y=');read(z.y);
write(f,z);
end;
Close(f);
assign(f,'1.dat');
reset(f);
read(f,a);
read(f,b);
read(f,c);
close(f);
writeln('Cтороны треугольника:');
writeln(a.tochka,b.tochka,' = ',sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)):5:2);
writeln(c.tochka,b.tochka,' = ',sqrt((c.x-b.x)*(c.x-b.x)+(c.y-b.y)*(c.y-b.y)):5:2);
writeln(a.tochka,c.tochka,' = ',sqrt((a.x-c.x)*(a.x-c.x)+(a.y-c.y)*(a.y-c.y)):5:2);
end.