Pagini recente » Cod sursa (job #1064266) | Cod sursa (job #992265) | Cod sursa (job #1066199) | Cod sursa (job #303293) | 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;
}