Pagini recente » Cod sursa (job #2581195) | Cod sursa (job #1392500) | Cod sursa (job #870723) | Cod sursa (job #689427) | Cod sursa (job #1939490)
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
ifstream fin("aria.in");
ofstream fout("aria.out");
double aria;
int main()
{
int n;
double x0, y0, x, y, xN, yN;
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;
}