#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
struct point {
int x;
int y;
} p[50];
double get_area(point p0, point p1, point p2) {
int x1 = p1.x - p0.x;
int y1 = p1.y - p0.y;
int x2 = p2.x - p0.x;
int y2 = p2.y - p0.y;
return (x1 * y2 - x2 * y1) / 2.0;
}
int main(int argc, char* argv[]) {
int n, i;
double area;
scanf("%d", &n);
for (i = 0; i < n; i++)
scanf("%d %d", &p[i].x, &p[i].y);
for (i = 2; i < n; i++)
area += get_area(p[0], p[i - 1], p[i]);
printf("%.1f\n", abs(area));
return 0;
}
|