using System;
class Program
{
static double Distance(double x1, double y1, double x2, double y2)
=> Math.Sqrt(Math.Pow(x2 - x1, 2) + Math.Pow(y2 - y1, 2));
static void Main()
{
double[] x = new double[4], y = new double[4];
Console.WriteLine("Введите координаты 4 вершин (x y):");
for (int i = 0; i < 4; i++)
{
Console.Write($"Вершина {i+1}: ");
var parts = Console.ReadLine().Split();
x[i] = double.Parse(parts[0]);
y[i] = double.Parse(parts[1]);
}
double perimeter = 0;
for (int i = 0; i < 4; i++)
{
int next = (i + 1) % 4;
perimeter += Distance(x[i], y[i], x[next], y[next]);
}
Console.WriteLine($"Периметр четырёхугольника: {perimeter:F2}");
}
}