Pagini recente » Borderou de evaluare (job #3014816) | Monitorul de evaluare | Borderou de evaluare (job #3014820) | Diferente pentru utilizator/madalene2960 intre reviziile 2 si 1 | Cod sursa (job #3315881)
#include <stdio.h>
int main(void)
{
int n;
double ans = 0;
scanf("%d", &n);
double x1, y1, xp, yp, x, y;
scanf("%lf%lf", &x1, &y1);
xp = x1;
yp = y1;
for(int i = 1; i < n; i++) {
scanf("%lf%lf", &x, &y);
ans += xp * y - x * yp;
xp = x;
yp = y;
}
ans += x * y1 - x1 * y;
ans /= 2;
printf("%.5lf\n", ans);
return 0;
}