Pagini recente » Cod sursa (job #1204807) | Cod sursa (job #597098) | Cod sursa (job #1132095) | Cod sursa (job #2090481) | Cod sursa (job #1418417)
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
ifstream fin("aria.in");
ofstream fout("aria.out");
const int NMax = 100005;
struct node{
long double x,y;
}A,B,C;
int main()
{
int n;
fin >> n >> A.x >> A.y;
C = A;
long double ans = 0;
for(int i = 2; i <= n; i++){
fin >> B.x >> B.y;
ans = ans + ((A.x * B.y) - (B.x * A.y));
A = B;
}
ans = ans + ((A.x * C.y) - (C.x * A.y));
ans /= 2;
fout << fixed << setprecision(6) << ans;
return 0;
}