Pagini recente » Cod sursa (job #1766135) | Cod sursa (job #2218227) | Cod sursa (job #75980) | Cod sursa (job #2965559) | Cod sursa (job #1647001)
#include <fstream>
#include <iomanip>
using namespace std;
ifstream in("aria.in");
ofstream out("aria.out");
int n;
double x, y, x1, y1;
int main()
{
in >> n;
in >> x >> y;
x1 = x;
y1 = y;
int xcurent, ycurent;
double arie = 0;
double arcurent;
while(n-- != 1)
{
in >> xcurent >> ycurent;
arcurent = (double)((double)((xcurent - x)*(ycurent + y)) / (double)(2));
arie += arcurent;
x = xcurent;
y = ycurent;
}
arcurent = (double)((double)((x1 - x)*(y1 + y)) / (double)(2));
arie += arcurent;
if(arie < 0)
arie = -arie;
out << setprecision(12) << arie;
return 0;
}