Pagini recente » Cod sursa (job #2455872) | Cod sursa (job #1321140) | Cod sursa (job #1020070) | Cod sursa (job #1139434) | Cod sursa (job #979618)
Cod sursa(job #979618)
#include <cstdio>
#include <cmath>
using namespace std;
int main () {
freopen ("aria.in", "r", stdin);
freopen ("aria.out", "w", stdout);
double x, _x, x1, y, _y, y1, A = 0;
int N, i;
scanf ("%d", &N);
scanf ("%lf%lf", &x1, &y1);
_x = x1;
_y = y1;
for (i = 2; i <= N; ++i)
scanf ("%lf%lf", &x, &y),
A += _x * y - _y * x,
_x = x,
_y = y;
A += x * y1 - y * x1;
printf ("%.5f", fabs (A / 2));
}