1
1
#include<cmath>
using namespace std;
float lab, lac, lae, lbc, lce, lcd, lde;
float A1,A2,A3,At;
struct punct{
float x,y;
};
punct A,B,C,D,E;
void citeste(){
cin>>A.x>>A.y;
cin>>B.x>>B.y;
cin>>C.x>>C.y;
cin>>D.x>>D.y;
cin>>E.x>>E.y;
}
float dist(float x1, float y1, float x2, float y2 ){
float d;
d=(float) sqrt(pow(x2-x1,2)+pow(y2-y1,2));
return d;
}
int aria(float la, float lb, float lc){
float p, A;
p=(float) (la+lb+lc)/2;
A=(float) sqrt(p*(p-la)*(p-lb)*(p-lc));
return A;
}
int main(){
citeste();
//triunghiul ABC
lab=dist(A.x,A.y,B.x,B.y);
lbc=dist(B.x,B.y,C.x,C.y);
lac=dist(A.x,A.y,C.x,C.y);
A1=aria(lab,lbc,lac);
//triunghiul CDE
lcd=dist(C.x,C.y,D.x,D.y);
lde=dist(D.x,D.y,E.x,E.y);
lce=dist(C.x,C.y,E.x,E.y);
A2=aria(lcd,lde,lce);
//triunghiul ACE
lae=dist(A.x,A.y,E.x,E.y);
A3=aria(lac,lce,lae);
At=A1+A2+A3;
cout<<"At="<<At<<endl;
}