Треугольник задан координатами своих вершин. Найти периметр треугольника.
Program formula_2;
Type coord = Record
x,y
: Real;
End;
Var a,b,c
: coord;
p : Real;
Begin
Write('Enter
A(x): '); ReadLn(a.x);
Write('Enter
A(y): '); ReadLn(a.y);
Write('Enter
B(x): '); ReadLn(b.x);
Write('Enter
B(y): '); ReadLn(b.y);
Write('Enter
C(x): '); ReadLn(c.x);
Write('Enter
C(y): '); ReadLn(c.y);
p := sqrt(sqr(a.x-b.x)+sqr(a.y-b.y))+sqrt(sqr(b.x-c.x)+sqr(b.y-c.y))+sqrt(sqr(c.x-a.x)+sqr(c.y-a.y));
WriteLn('P=',p:2:5);
End.