Pagini recente » Cod sursa (job #1420793) | Cod sursa (job #679441) | Cod sursa (job #455487) | Cod sursa (job #2206216) | Cod sursa (job #1939493)
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
ifstream fin("aria.in");
ofstream fout("aria.out");
long double aria;
long double x0, y0, x, y, xN, yN;
int main()
{
int n;
fin>>n;
fin>>x0>>y0;
x = x0;
y = y0;
while(fin>>xN>>yN) {
aria +=(x*yN-y*xN);
x = xN;
y = yN;
}
aria +=(xN*y0-yN*x0);
aria = aria / 2.0;
fout<<fixed<<setprecision(8)<<aria<<'\n';
fin.close();
fout.close();
return 0;
}