Cod sursa(job #3309121)
| Utilizator | Data | 1 septembrie 2025 14:54:52 | |
|---|---|---|---|
| Problema | Aria | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.45 kb |
#include <fstream>
#include<deque>
#include<algorithm>
#include<string>
#include<bits/stdc++.h>
using namespace std;
ifstream fin("aria.in");
ofstream fout("aria.out");
int main()
{
int n;
long double x1,y1,xi,yi,xj,yj, arie=0;
fin>>n;
fin>>x1>>y1;
xi=x1;
yi=y1;
for(int i=1;i<n;i++){
fin>>xj>>yj;
arie+=(xi*yj-xj*yi);
xi=xj;
yi=yj;
}
arie+=(xi*y1-x1*yi);
fout<<setprecision(6)<<fixed<<arie/2.0;
}
