Pagini recente » Cod sursa (job #2981328) | Cod sursa (job #1364002) | Cod sursa (job #453687) | Cod sursa (job #1862164) | Cod sursa (job #2541796)
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n, x[1000000], y[1000000];
float aria;
FILE *F= fopen("aria.in","r");;
FILE *G= fopen("aria.out","w");;
fscanf(F,"%d", &n);
for(int i=0; i<n; i++)
{
fscanf(F,"%d", &x[i]);
fscanf(F,"%d", &y[i]);
}
for(int i=0; i<n; i++)
{
aria=1/2*(x[i]*y[i+1]-x[i+1]*y[i]);
}
fprintf(G,"%.5f", aria);
fclose(G);
fclose(F);
return 0;
}