Pagini recente » Borderou de evaluare (job #173730) | Cod sursa (job #3297975) | Cod sursa (job #2655517) | Cod sursa (job #2655518) | Cod sursa (job #1541107)
#include <bits/stdc++.h>
using namespace std;
int main()
{
ifstream f("aria.in");
ofstream g("aria.out");
double A = 0;
int N, x1, y1, x, y, xp, yp;
f >> N >> x1 >> y1;
xp = x1; yp = y1;
for(int i = 2; i <= N; i ++) {
f >> x >> y;
A += (xp * y - yp * x);
xp = x; yp = y;
}
A += (xp * x1 - yp * y1);
g << setprecision(10) << A / 2 << "\n";
return 0;
}