program fantscrin;
var x_1,x_2,h,j,i: integer; f: boolean; a: array [1..3] of string; k,l: string;
function chek_number(a: integer): boolean;
var k: integer;
begin
if (a mod 2 < > 0) then
chek_number: =false;
exit;
end;
while a > 0 do
a: =a div 10;
k: =k+1;
if (k = 3) then chek_number: =true
else chek_number: =false;
f: =false;
while f = false do
write('введите 1-ое число: '); readln(x_1);
f: =chek_number(x_1);
write('введите 2-ое число: '); readln(x_2);
f: =chek_number(x_2);
if (f) then if (x_1 < > x_2) then f: =true
else f: =false;
str(x_2,l);
str(x_1,k);
i: =1;
h: =1;
while i< =3 do
j: =1;
while j< =3 do
if (k[i] = l[j]) then
a[h]: =k[i];
h: =h+1;
j: =j+1;
i: =i+1;
writeln('');
while i < =3 do
write (a[i], ' ');
end.
program fantscrin;
var x_1,x_2,h,j,i: integer; f: boolean; a: array [1..3] of string; k,l: string;
function chek_number(a: integer): boolean;
var k: integer;
begin
if (a mod 2 < > 0) then
begin
chek_number: =false;
exit;
end;
while a > 0 do
begin
a: =a div 10;
k: =k+1;
end;
if (k = 3) then chek_number: =true
else chek_number: =false;
end;
begin
f: =false;
while f = false do
begin
write('введите 1-ое число: '); readln(x_1);
f: =chek_number(x_1);
end;
f: =false;
while f = false do
begin
write('введите 2-ое число: '); readln(x_2);
f: =chek_number(x_2);
if (f) then if (x_1 < > x_2) then f: =true
else f: =false;
end;
str(x_2,l);
str(x_1,k);
i: =1;
h: =1;
while i< =3 do
begin
j: =1;
while j< =3 do
begin
if (k[i] = l[j]) then
begin
a[h]: =k[i];
h: =h+1;
end;
j: =j+1;
end;
i: =i+1;
end;
writeln('');
i: =1;
while i < =3 do
begin
write (a[i], ' ');
i: =i+1;
end;
end.
using System;
class Program
{
static void Main()
{
int x1 = 2, y1 = 1;
int x2 = 6, y2 = 5;
int x3 = 10, y3 = 1;
var a = Distance(x2, y2, x3, y3);
var b = Distance(x1, y1, x3, y3);
var c = Distance(x2, y2, x1, y1);
Console.WriteLine("S = {0}", Square(a, b, c));
Console.ReadKey();
}
//растояние между точками
static double Distance(int x1, int y1, int x2, int y2)
{
return Math.Sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
}
//формула герона
static double Square(double a, double b, double c)
{
var p = (a + b + c) / 2;
return Math.Sqrt(p * (p - a) * (p - b) * (p - c));
}
// теорема косинусов
static double Angle(double a, double b, double c)
{
return Math.Acos((b * b + c * c - a * a) / (2 * b * c));
}
static bool IsAcuteAngel(double alpha)
{
return alpha < Math.PI / 2;
}
}