Mai intai trebuie sa te autentifici.
Cod sursa(job #1780197)
| Utilizator | Data | 15 octombrie 2016 22:11:05 | |
|---|---|---|---|
| Problema | Aria | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.52 kb |
#include <cstdio>
#include <cmath>
using namespace std;
int n;
double ans,x1,x2,y1,y2;
int main()
{
freopen("aria.in","r",stdin);
freopen("aria.out","w",stdout);
int i;
double xx,yy;
scanf("%d",&n);
scanf("%lf%lf",&x1,&y1);
xx=x1;
yy=y1;
for(i=2;i<=n;i++)
{
scanf("%lf%lf",&x2,&y2);
ans+=x1*y2-x2*y1;
x1=x2;
y1=y2;
}
ans+=x1*yy-xx*y1;
ans=fabs(ans/2.0);
printf("%.5f\n",ans);
return 0;
}
