Pagini recente » Cod sursa (job #704559) | Cod sursa (job #1111) | Cod sursa (job #2096947) | Cod sursa (job #1910400) | Cod sursa (job #2878059)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct Point {
double x, y;
};
double Product(Point a, Point b) {
return a.x * b.y - b.x * a.y;
}
int main () {
ifstream f("aria.in");
ofstream g("aria.out");
int n; f >> n;
vector<Point> v(n);
for(int i=0; i<n; i++) f >> v[i].x >> v[i].y;
v.emplace_back(v[0]);
double area = 0;
for(int i=0; i<n; i++)
area += 1LL * Product(v[i], v[i+1]);
g << double(area / 2.00);
return 0;
}