Pagini recente » Cod sursa (job #141752) | Cod sursa (job #3129478) | Cod sursa (job #1025967) | Cod sursa (job #2343863) | Cod sursa (job #1817261)
#include <iostream>
#include <stdio.h>
#include <iomanip>
#define double long double
using namespace std;
int main(){
int n , i;
double xst , yst , x , y, xprec , yprec ;
double s = 0 ;
freopen("aria.in","r",stdin);
freopen("aria.out","w",stdout);
scanf("%d",&n);
cin>>xst>>yst;
//scanf("%llf%llf",&xst,&yst);
xprec = xst;
yprec = yst;
for ( i = 1 ; i < n ; i++ ){
cin>>x>>y;
// scanf("%llf%llf",&x,&y);
s += ( xprec * y ) - yprec * x;
xprec = x ;
yprec = y ;
}
s += ( xprec * yst) - yprec * xst ;
cout << s/2.0 ;
//printf("%.5llf", s/2 );
return 0;
}