Cod sursa(job #2925285)
| Utilizator | Data | 13 octombrie 2022 17:27:40 | |
|---|---|---|---|
| Problema | Aria | Scor | 10 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.48 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream in("aria.in");
ofstream out("aria.out");
struct punct
{
long double x,y;
};
int n;
long double a;
punct v[100005];
int main()
{
in >> n;
for (int i = 1; i <= n; i++)
in >> v[i].x >> v[i].y;
v[n + 1] = v[1];
for (int i = 1; i <= n; i++)
a += (v[i].x * v[i + 1].y - v[i + 1].x * v[i].y);
long double dv = 2;
out.precision(6);
out << a / dv;
return 0;
}
