using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
double x1, x2, x3, y1, y2, y3;
Console.WriteLine("Введите координаты:");
x1 = Double.Parse(Console.ReadLine());
y1 = Double.Parse(Console.ReadLine());
x2 = Double.Parse(Console.ReadLine());
y2 = Double.Parse(Console.ReadLine());
x3 = Double.Parse(Console.ReadLine());
y3 = Double.Parse(Console.ReadLine());
double dist12 = Math.Sqrt(Math.Pow((x2 - x1), 2) + Math.Pow((y2 - y1), 2));
double dist13 = Math.Sqrt(Math.Pow((x3 - x1), 2) + Math.Pow((y3 - y1), 2));
double dist23 = Math.Sqrt(Math.Pow((x3 - x2), 2) + Math.Pow((y3 - y2), 2));
double P = dist12 + dist13 + dist23;
double p = P / 2;
double Area = p * (p - dist12) * (p - dist13) * (p - dist23);
Console.WriteLine("Площадь {0}", Area);
Console.ReadKey();
}
}
}
c:array of array of integer;
ma:array of array of integer;
i,j,n:integer;
begin;
randomize;
readln(n);
setlength(a,n+1); //задаём размерность динамических массивов
setlength(c,n+1);
setlength(ma,n+1);
for i:=1 to n do
begin;
setlength(a[i],n+1);
setlength(c[i],n+1);
setlength(ma[i],n+1);
end;
writeln('Matrix A:'); //генерируем массив псеводслучайных чисел
for i:=1 to n do begin;
writeln;
for j:=1 to n do
begin;
a[i,j]:=random(10);
write(a[i,j]:4);
end;
end;
writeln;
writeln('Matrix C:'); //аналогично
for i:=1 to n do
begin;
writeln;
for j:=1 to n do
begin;
c[i,j]:=random(10);
write(c[i,j]:4);
end;
end;
for i:=1 to n do //сохраняем матрицу C для транспонации
for j:=1 to n do
ma[i,j]:=c[i,j];
writeln;
writeln('Transpose matrix C:'); //транспонируем C
for i:=1 to n do
begin;
writeln;
for j:=1 to n do
begin;
c[i,j]:=ma[j,i];
write(c[i,j]:4);
end;
end;
writeln;
writeln('Final matrix:'); // получаем финальную матрицу
for i:=1 to n do
begin;
writeln;
for j:=1 to n do
begin;
ma[i,j]:=2*c[i,j]*a[i,j];
{по свойству дистрибутивности матриц С(A+A)=C*A+C*A=2*C*A}
write(ma[i,j]:4);
end;
end;
end.