Pagini recente » Cod sursa (job #939170) | Cod sursa (job #865148) | Cod sursa (job #218935) | Cod sursa (job #561278) | Cod sursa (job #2088659)
#include <fstream>
#include <iomanip>
using namespace std;
ifstream f("aria.in");
ofstream g("aria.out");
struct stefan {
double a, b;
};
double t;
int n, i;
stefan x, y, o;
int main()
{
f>>n>>x.a>>x.b; o=x;
for(i=2; i<=n; i++) {
f>>y.a>>y.b;
t+=x.a*y.b-y.a*x.b;
x=y;
}
t+=x.a*o.b-x.b*o.a;
g<<setprecision(6)<<fixed<<t/2;
f.close();
g.close();
return 0;
}