program TriangleAreaPerimeter;
varx1, y1, x2, y2, x3, y3: real;side1, side2, side3, perimeter, s, area: real;
beginwriteln('Enter the coordinates of the first vertex (x1, y1):');readln(x1, y1);
writeln('Enter the coordinates of the second vertex (x2, y2):');readln(x2, y2);
writeln('Enter the coordinates of the third vertex (x3, y3):');readln(x3, y3);
side1 := sqrt(sqr(x2 - x1) + sqr(y2 - y1));side2 := sqrt(sqr(x3 - x2) + sqr(y3 - y2));side3 := sqrt(sqr(x1 - x3) + sqr(y1 - y3));
perimeter := side1 + side2 + side3;
s := perimeter / 2;area := sqrt(s (s - side1) (s - side2) * (s - side3));
writeln('Perimeter of the triangle: ', perimeter:0:2);writeln('Area of the triangle: ', area:0:2);end.
program TriangleAreaPerimeter;
var
x1, y1, x2, y2, x3, y3: real;
side1, side2, side3, perimeter, s, area: real;
begin
writeln('Enter the coordinates of the first vertex (x1, y1):');
readln(x1, y1);
writeln('Enter the coordinates of the second vertex (x2, y2):');
readln(x2, y2);
writeln('Enter the coordinates of the third vertex (x3, y3):');
readln(x3, y3);
side1 := sqrt(sqr(x2 - x1) + sqr(y2 - y1));
side2 := sqrt(sqr(x3 - x2) + sqr(y3 - y2));
side3 := sqrt(sqr(x1 - x3) + sqr(y1 - y3));
perimeter := side1 + side2 + side3;
s := perimeter / 2;
area := sqrt(s (s - side1) (s - side2) * (s - side3));
writeln('Perimeter of the triangle: ', perimeter:0:2);
writeln('Area of the triangle: ', area:0:2);
end.