Pagini recente » Cod sursa (job #712754) | Cod sursa (job #2180038) | Istoria paginii runda/shiggydiggy123/clasament | Cod sursa (job #2054573) | Cod sursa (job #2241258)
#include <iostream>
#include<fstream>
#include <math.h>
using namespace std;
ifstream fin ("aria.in");
ofstream fout ("aria.out");
int main()
{
int n;
long double x1, y1, x2, y2, x, y, ans = 0;
fin >> n >> x1 >> y1;
x2 = x1 ;
y2 = y1;
for (int i = 1 ; i <= n; ++i){
fin >> x >> y;
ans += (x1*y - x*y1);
x1 = x;
y1 = y;
}
ans +=(x1*y2 - x2*y1);
ans = ans /2.0;
fout << fabs(ans);
return 0;
}