Pagini recente » Cod sursa (job #711028) | Cod sursa (job #567197) | Cod sursa (job #1196537) | Cod sursa (job #3283738) | Cod sursa (job #1921926)
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
freopen( "aria.in", "r", stdin );
freopen( "aria.out", "w", stdout );
int n, i;
double a=0, x, y, x1, y1, x2, y2;
scanf( "%d%lf%lf", &n, &x, &y );
x1=x;
y1=y;
for( i=2;i<=n;i++ )
{
scanf( "%lf%lf", &x2, &y2 );
a+=(x1-x2)*(y1+y2);
x1=x2;
y1=y2;
}
a=fabs(a+(x1-x)*(y1+y))/2;
printf( "%.6lf", a );
return 0;
}