Cod sursa(job #2311227)
Utilizator | Data | 2 ianuarie 2019 19:42:32 | |
---|---|---|---|
Problema | Aria | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.43 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("aria.in");
ofstream fout("aria.out");
int n;
struct nod {
ld x, y;
} v[100002];
int main() {
fin >> n;
for (int i = 1; i <= n; i++)
fin >> a[i].x >> a[i].y;
v[n + 1] = v[1];
long double ans = 0;
for (int i = 1; i <= n; i++)
ans += a[i].x * a[i + 1].y - a[i + 1].x * a[i].y;
fout << fixed << setprecision(6) << abs(ans) / 2.0;
return 0;
}