Răspuns :
Calculeaza ariile cu formula lui Heron:
#include <iostream>
#include <math.h>
using namespace std;
struct triunghi
{
float lat1;
float lat2;
float lat3;
};
int main() {
triunghi tr1, tr2;
int i;
cin >> tr1.lat1 >> tr1.lat2 >> tr1.lat3;
cin >> tr2.lat1 >> tr2.lat2 >> tr2.lat3;
float semiperim1, semiperim2;
float arie1, arie2;
semiperim1 = (tr1.lat1 + tr1.lat2 + tr1.lat1) / 2;
semiperim2 = (tr2.lat1 + tr2.lat2 + tr2.lat1) / 2;
arie1 = semiperim1 * (semiperim1 - tr1.lat1) * (semiperim1 - tr1.lat2) * (semiperim1 - tr1.lat3);
arie1 = sqrt(arie1);
arie2 = semiperim2 * (semiperim2 - tr2.lat1) * (semiperim2 - tr2.lat2) * (semiperim2 - tr2.lat3);
arie2 = sqrt(arie2);
if (arie1 == arie2)
cout << "Triunghiurile au ariile egale.";
else
cout << "Triunghiurile NU au ariile egale.";
return 0;
}