Pagini recente » Cod sursa (job #1337240) | Cod sursa (job #170370) | Cod sursa (job #967279) | Cod sursa (job #1002965) | Cod sursa (job #1146383)
/*
Keep It Simple!
*/
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include<stdio.h>
#define MaxN 100001
int N;
double S;
struct Point { double x, y; }Points[MaxN];
double Abs(double a) { return (a) < 0 ? (-a) : (a); }
int main()
{
freopen("aria.in", "r", stdin);
freopen("aria.out", "w", stdout);
scanf("%d", &N);
for (int i = 1; i <= N; i++)
scanf("%lf%lf", &Points[i].x, &Points[i].y);
Points[0] = Points[N];
for (int i = 1; i <= N; i++)
S = S+(Points[i - 1].x * Points[i].y) - (Points[i - 1].y * Points[i].x);
S = Abs(S);
S /= 2;
printf("%.5lf", S);
return 0;
}