Pagini recente » Cod sursa (job #1606364) | Cod sursa (job #2693155) | Cod sursa (job #1434111) | Cod sursa (job #1592794) | Cod sursa (job #3339068)
#include <fstream>
#include <iostream>
#include <iomanip>
using namespace std;
ifstream fin("aria.in");
ofstream fout("aria.out");
int main() {
int n;
double ans = 0, x, y, a, b;
fin >> n;
fin >> x >> y;
double xx = x, yy = y;
for(; n > 1; --n) {
fin >> a >> b;
ans += (x * b - a * y);
x = a;
y = b;
}
fin.close();
ans += (x * yy - xx * y);
ans *= 0.5;
fout << fixed << setprecision(5) << ans;
fout << "\n";
return 0;
}