Cod sursa(job #1970958)
| Utilizator | Data | 19 aprilie 2017 18:54:16 | |
|---|---|---|---|
| Problema | Aria | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.45 kb |
#include<iostream>
#include<fstream>
using namespace std;
int n;
struct punct{
long x;
long y;
};
punct a[100010];
long long arie;
int main(){
ifstream f("aria.in",fstream::in);
ofstream g("aria.out",fstream::out);
f>>n;
for(int i=0;i<n;i++)
f>>a[i].x>>a[i].y;
for(int i=0;i<n-1;i++)
arie=arie+(a[i].x*a[i+1].y-a[i+1].x*a[i].y);
arie=arie+a[n-1].x*a[0].y-a[0].x*a[n-1].y;
arie=arie/2;
g<<arie;
}
