Pagini recente » Cod sursa (job #1952006) | Cod sursa (job #1955970) | Cod sursa (job #1944078) | Cod sursa (job #1218791) | Cod sursa (job #2067742)
#include <bits/stdc++.h>
using namespace std;
long double sol, a, b, x, y, a1, b1;
int n;
int main()
{
ifstream fin ("aria.in");
ofstream fout ("aria.out");
fin >> n >> x >> y;--n;
a1 = x; b1 = y;
while(n--){
a = x; b = y;
fin >> x >> y;
sol += (a*y-b*x);
}
sol += (x*b1-a1*y);
fout << fixed << setprecision(7) << abs(sol/2.0) << "\n";
fin.close();
fout.close();
return 0;
}