Cod sursa(job #2364094)
| Utilizator | Data | 3 martie 2019 21:01:09 | |
|---|---|---|---|
| Problema | Aria | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.48 kb |
#include <bits/stdc++.h>
const int MAX_N = 100000;
using namespace std;
ifstream fin("aria.in");
ofstream fout("aria.out");
int n, x[MAX_N + 5], y[MAX_N + 5];
double s;
int main() {
fin >> n;
for(int i = 1; i <= n; i++)
fin >> x[i] >> y[i];
x[n + 1] = x[1];
y[n + 1] = y[1];
for(int i = 1; i <= n; i++)
s += 0.5 * (x[i] * y[i + 1] - y[i] * x[i + 1]);
fout << fixed << setprecision(5) << s << '\n';
return 0;
}
