Pagini recente » Istoria paginii planificare/sedinta-201410xx | Atasamentele paginii Clasament 3oredechin | Cod sursa (job #2073570) | Cod sursa (job #1319769) | Cod sursa (job #904087)
Cod sursa(job #904087)
#include <fstream>
#include <iomanip>
#include <cmath>
using namespace std;
const int Nmax = 100010;
ifstream F("aria.in");
ofstream G("aria.out");
typedef pair<double,double> Pair;
#define x first
#define y second
int N;
Pair P[Nmax];
double Out;
int main ()
{
F>>N;
for (int i=1;i<=N;++i)
F>>P[i].x>>P[i].y;
P[++N]=P[1];
for (int i=1;i<N;++i)
Out += (1LL*P[i].x*P[i+1].y) - (1LL*P[i+1].x*P[i].y);
Out = fabs(Out) / 2.0;
G<<fixed<<setprecision(6)<<Out<<'\n';
}