Cod sursa(job #1196961)
Utilizator | Data | 10 iunie 2014 00:17:21 | |
---|---|---|---|
Problema | Aria | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.36 kb |
#include <cstdio>
using namespace std;
int main()
{
double s=0, x1, y1, xi, yi, xj, yj;
int n, i;
freopen("aria.in", "r", stdin);
freopen("aria.out", "w", stdout);
scanf("%d%lf%lf", &n, &x1, &y1);
xi=x1; yi=y1;
for(i=2; i<=n; i++){
scanf("%lf%lf", &xj, &yj);
s = s + xi*yj-xj*yi;
xi = xj; yj = yi;
}
s = s + xj*y1-x1*yj;
printf("%lf", s);
}