Pagini recente » Cod sursa (job #3208443) | Cod sursa (job #537740) | Cod sursa (job #874938) | Cod sursa (job #200447) | Cod sursa (job #3293952)
#include <bits/stdc++.h>
#define MAXN 100000
using namespace std;
struct coord {
long long x , y;
};
coord v[MAXN + 1];
int main() {
ifstream cin( "aria.in" );
ofstream cout( "aria.out" );
int n , i;
long long x , y , xc , yc , xf , yf;
long double ans;
ans = 0;
cin >> n;
for( i = 0 ; i < n ; i++ )
cin >> v[i].x >> v[i].y;
for( i = 0 ; i < n ; i++ )
ans += v[i].x * v[( i + 1 ) % n].y - v[i].y * v[( i + 1 ) % n].x;
ans = abs( ans );
ans /= 2;
cout << fixed << setprecision( 7 ) << ans << '\n';
return 0;
}