Cod sursa(job #2067261)
| Utilizator | Data | 16 noiembrie 2017 08:13:49 | |
|---|---|---|---|
| Problema | Aria | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.46 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("aria.in");
ofstream fout ("aria.out");
struct coord
{
long double x, y;
}v[100001];
long double sol;
int main()
{
ios::sync_with_stdio(false);
int n;
fin>>n;
for ( int i = 0; i < n; ++i )
fin>>v[i].x>>v[i].y;
v[n] = v[0];
for ( int i = 0; i < n; ++i )
sol += v[i].x*v[i+1].y - v[i].y*v[i+1].x;
fout<<setprecision(6)<<fixed<<abs(sol)/2;
}
