Pagini recente » Cod sursa (job #2634995) | Cod sursa (job #93976) | Cod sursa (job #432657) | Cod sursa (job #2190973) | Cod sursa (job #2652914)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
string file="aria";
ifstream fin(file+".in");
ofstream fout(file+".out");
struct punct {
ld x, y;
}A, B, start;
int main()
{
int n;
ld arie = 0;
fin >> n;
fin >> start.x >> start.y;
A = start;
for(int i = 2; i <=n; i++){
fin >> B.x >> B.y;
arie += (A.x * B.y - A.y * B.x);
A = B;
}
arie += (start.y * B.x - start.x * B.y);
fout << fixed << setprecision (8) << arie / 2.0;
return 0;
}