Pagini recente » Cod sursa (job #428550) | Cod sursa (job #1588423) | Cod sursa (job #2161969) | Cod sursa (job #579190) | Cod sursa (job #1404692)
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <algorithm>
using namespace std;
int n;
long double x, y, xprim, yprim, newX, newY, S;
int main()
{
freopen("aria.in", "r", stdin);
freopen("aria.out", "w", stdout);
cin>>n;
cin>>x>>y;
xprim = x;
yprim = y;
for (int i = 2; i <= n; ++i){
cin>>newX>>newY;
S = S + x * newY - newX * y;
x = newX;
y = newY;
}
S = S + newX * yprim - xprim * newY;
cout<<setprecision(5)<<fixed<<S/2<<"\n";
return 0;
}