Pagini recente » Cod sursa (job #1480039) | Cod sursa (job #2436951) | Cod sursa (job #2593303) | Cod sursa (job #1829207) | Cod sursa (job #2472307)
#include<fstream>
#include<iomanip>
#define x first
#define y second
using namespace std;
const int Maxx=1e5+1;
ifstream fin("aria.in");
ofstream fout("aria.out");
pair<double,double> A[Maxx];
int main() {
int points;
fin>>points;
for (int i=1;i<=points;++i){
fin>>A[i].x>>A[i].y;
}
double aria=0;
A[points+1]=A[1];
for (int i=1;i<=points;++i){
aria+=(A[i].x*A[i+1].y-A[i+1].x*A[i].y);
}
fout<<setprecision(6)<<fixed<<(aria/2.0);
return 0;
}