Pagini recente » Cod sursa (job #1793777) | Cod sursa (job #825886) | Cod sursa (job #1850771) | Cod sursa (job #521265) | Cod sursa (job #2309470)
#include <bits/stdc++.h>
#define x first
#define y second
/// TONI BO$$ was here
/// #MLC
using namespace std;
pair <long double,long double> v[100001];
int main()
{
int n,i,j;
ios::sync_with_stdio(false);
ifstream in("aria.in");
ofstream out("aria.out");
in>>n;
long double s=0;
for(i=0; i<n; i++)
in>>v[i].x>>v[i].y;
for(i=0; i<n; i++)
{
j=(i+1)%n;
s+=(v[i].x*v[j].y-v[i].y*v[j].x);
}
out<<fixed<<setprecision(8)<<s/2.0;
return 0;
}