Cod sursa(job #2412024)

Utilizator DavidAA007Apostol David DavidAA007 Data 21 aprilie 2019 16:02:53
Problema Aria Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.37 kb
#include<fstream>
using namespace std;
ifstream fin("aria.in");
ofstream fout("aria.out");
int n,i,s;
struct coordonate
{
    int x;
    int y;
};
coordonate v[100005];
int main()
{
    fin>>n;
    for(i=1;i<=n;i++)
        fin>>v[i].x>>v[i].y;
    for(i=1;i<n;i++)
        s=s+((v[i].x*v[i+1].y)-(v[i+1].x*v[i].y));
    fout<<s;
    fin.close();
    fout.close();
    return 0;
}