Pagini recente » Borderou de evaluare (job #2612194) | Cod sursa (job #374119) | Diferente pentru problema/dk intre reviziile 14 si 13 | Cod sursa (job #2963877) | Cod sursa (job #2084720)
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
int main()
{
ifstream f("aria.in");
ofstream g("aria.out");
int n;
double rez=0;
f>>n;
double x1=0,x2=0,y1=0,y2=0,xp=0,yp=0;
f>>x1>>y1;
xp=x1;yp=y1;
for(int i=1;i<n;i++)
{
f>>x2>>y2;
rez+=x1*y2-x2*y1;
x1=x2;
y1=y2;
}
rez+=xp*y2-x2*yp;
g<<setprecision(6)<<fixed<<rez;
return 0;
}