Pagini recente » Cod sursa (job #1300878) | Cod sursa (job #1518472) | Cod sursa (job #1330426) | Cod sursa (job #1859422) | Cod sursa (job #2303304)
#include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
pair<int, int> pct[100005];
int main()
{
ifstream fin("aria.in");
ofstream fout("aria.out");
int n;
fin >> n;
double arie = 0.00000;
for(int i = 1; i <= n; ++i)
fin >> pct[i].x >> pct[i].y;
pct[n + 1] = pct[1];
for(int i = 1; i <= n; ++i)
arie += 1.000000 * pct[i].x * pct[i + 1].y - 1.000000 * pct[i + 1].x * pct[i].y;
arie /= 2;
fout << arie;
return 0;
}