Pagini recente » Cod sursa (job #2707314) | Cod sursa (job #2443099) | Cod sursa (job #2901388) | Cod sursa (job #352916) | Cod sursa (job #1871232)
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int n;
struct punct{
double x;
double y;
}a[100001];
void Citire()
{
freopen("aria.in", "r", stdin);
scanf("%d\n", &n);
for(int i=0; i<n; i++)
{
scanf("%lf %lf\n", &a[i].x, &a[i].y);
}
a[n]=a[0];
}
int Aria()
{
double aria=0;
for(int j=0; j<=n; j++)
aria+=abs(a[j].x*a[j+1].y-a[j].y*a[j+1].x);
return aria;
}
int main()
{
freopen("aria.out", "w", stdout);
Citire();
printf ("%lf", fabs (Aria() / 2.0));
return 0;
}