Pagini recente » Cod sursa (job #140641) | Cod sursa (job #2195959) | Cod sursa (job #1561708) | Cod sursa (job #94836) | Cod sursa (job #979615)
Cod sursa(job #979615)
#include <cstdio>
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", A / 2);
}