Pagini recente » Cod sursa (job #3173933) | Cod sursa (job #2902761) | Cod sursa (job #3181492) | Cod sursa (job #101929) | Cod sursa (job #3222619)
#include<fstream>
#include<cmath>
#include<iomanip>
std::ifstream fin("aria.in");
std::ofstream fout("aria.out");
struct point{
long double x, y;
}vec[100005];
int main()
{
int n;
fin>>n;
for(int i=0; i<n; ++i)
fin>>vec[i].x>>vec[i].y;
vec[n]=vec[0];
long double arie=0;
for(int i=0; i<n; ++i)
arie+=(vec[i].x*vec[i+1].y-vec[i+1].x*vec[i].y);
fout<<std::fixed<<std::setprecision(5)<<10000*std::abs(arie)/20000.0;
return 0;
}