Pagini recente » Cod sursa (job #2177905) | Cod sursa (job #1551098) | Cod sursa (job #1487832) | Cod sursa (job #1154717) | Cod sursa (job #2067733)
#include <bits/stdc++.h>
using namespace std;
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(10) << abs(sol/2.0) << "\n";
fin.close();
fout.close();
return 0;
}