Pagini recente » Atasamentele paginii cuantictiori | Cod sursa (job #1570753) | Cod sursa (job #2748297) | Statistici Mihnea (MihneaGhira) | Cod sursa (job #1027732)
#include <fstream>
std::ifstream f ("aria.in");
std::ofstream g ("aria.out");
std::pair<int, int> V[100005];
int n;
double A;
int main()
{
f >> n;
for(int i = 0 ; i < n; i++)
f >> V[i].first >> V[i].second;
V[n] = V[0];
for(int i = 0; i < n; i++)
A = A + (V[i].first * V[i+1].second - V[i+1].first * V[i].second);
g << A / 2.00;
return 0;
}