Pagini recente » Cod sursa (job #922107) | Cod sursa (job #1739150) | Cod sursa (job #139345) | Cod sursa (job #1121476) | Cod sursa (job #1404463)
#include<bits/stdc++.h>
#define Nmax 100005
#define X first
#define Y second
using namespace std;
pair < double , double > Point[Nmax];
int N;
void Read()
{
freopen("aria.in", "r", stdin);
scanf("%d", &N);
for(int i = 1; i <= N; ++ i)
scanf("%lf %lf", &Point[i].X, &Point[i].Y);
Point[N + 1] = Point[1];
}
double Arie()
{
double Aria = 0;
for(int i = 1; i <=N; ++ i)
Aria += Point[i].X * Point[i + 1].Y - Point[i + 1].X * Point[i].Y;
return Aria;
}
int main()
{
Read();
fprintf(fopen("aria.out", "w"), "%.0lf", Arie() * 0.5);
return 0;
}