#include <iostream>
#include <cmath>
using namespace std;
#define ld long double
struct triangle{
ld a;
ld b;
ld c;
};
ld square(triangle t){
ld p = (t.a + t.b + t.c)/2;
return sqrt(p * (p - t.a) * (p - t.b) * (p - t.c));
}
triangle t1,t2;
void solve(){
if(square(t1) == square(t2))
cout << "ИСТИНА";
else
cout << "ЛОЖЬ";
}
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> t1.a >> t1.b >> t1.c >> t2.a >> t2.b >> t2.c;
solve();
}
using System;
namespace ConsoleApp5
{
class Program
{
static void Main(string[] args)
{
bool f;
double a,b,c, s, s1;
a = double.Parse(Console.ReadLine());
b = double.Parse(Console.ReadLine());
c = double.Parse(Console.ReadLine());
s = Math.Sqrt(((a + b + c) / 2) * (((a + b + c) / 2) - a) * (((a + b + c) / 2) - b) * (((a + b + c) / 2) - c));
a = double.Parse(Console.ReadLine());
b = double.Parse(Console.ReadLine());
c = double.Parse(Console.ReadLine());
s1= Math.Sqrt(((a + b + c) / 2) * (((a + b + c) / 2) - a) * (((a + b + c) / 2) - b) * (((a + b + c) / 2) - c));
if (s == s1)
f = true;
else
f = false;
Console.WriteLine(f);
Console.ReadKey();
}
}
}
Поделитесь своими знаниями, ответьте на вопрос:
Pascal отсортировать по возрастанию положительные элементы массивы вывести исходный и изменить массивы можно использовать любой метод сортировки массив заполнить случайными положительными и отрицательными целым числами
//Pascal ABC.NET 3.1 сборка 1219
Const
n=10;
Var
i:integer;
procedure booblesort(var ar:array of integer;n:integer);
Var i,j:integer;
begin
for i:=0 to n-1 do
for j:=i+1 to n do
if (ar[i]>ar[j]) and (ar[i]>0) and (ar[j]>0) then swap(ar[i],ar[j]);
end;
begin
randomize;
var ar:=ArrRandomInteger(n,-10,10);
writeln('First array:');
ar.Println;
booblesort(ar,n-1);
writeln('Final array:');
ar.println;
end.
Пример работы программы:
First array:
-9 -5 5 -9 4 -3 -9 4 10 8
Final array:
-9 -5 4 -9 4 -3 -9 5 8 10