Pagini recente » Cod sursa (job #333018) | Cod sursa (job #967979) | Cod sursa (job #602145) | Cod sursa (job #568046) | Cod sursa (job #1574003)
#include <iostream>
#include <fstream>
#define NMAX 100005
using namespace std;
long double x1, y1, x2, y2, firstx, firsty, aria;
int N;
int main()
{
freopen("aria.in","rt",stdin);
freopen("aria.out","wt",stdout);
scanf("%d%Lf%Lf", &N, &x1, &y1);
firstx=x1;
firsty=y1;
for(int i=2;i<=N;i++){
scanf("%Lf%Lf", &x2, &y2);
aria+= x1*y2 - x2*y1;
x1=x2;
y1=y2;
}
aria+= firstx*y2 - x2*firsty;
cout<<aria<<'\n';
return 0;
}