Cod sursa(job #1826104)
| Utilizator | Data | 10 decembrie 2016 09:52:03 | |
|---|---|---|---|
| Problema | Aria | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.46 kb |
#include <bits/stdc++.h>
using namespace std;
int n;
double x2,x1,y3,y2,x,y;
long double s;
int main(){
freopen("aria.in","r",stdin);
freopen("aria.out","w",stdout);
scanf("%d",&n);
scanf("%lf%lf",&x,&y);
x1=x;
y3=y;
for (int i=2;i<=n;i++){
scanf("%lf%lf",&x2,&y2);
s+=(x1*y2-x2*y3);
x1=x2;
y3=y2;
}
s+=(x2*y-x*y2);
cout<<fixed<<setprecision(6)<<s*0.5;
return 0;
}
