Pagini recente » Cod sursa (job #2414389) | Cod sursa (job #2657753) | Cod sursa (job #1176107) | Cod sursa (job #807302) | Cod sursa (job #1216032)
#include <fstream>
#include <iomanip>
const char IN [ ] = "aria.in" ;
const char OUT [ ] = "aria.out" ;
const int MAX = 100014 ;
using namespace std;
ifstream fin ( IN ) ;
ofstream fout ( OUT ) ;
struct puncte {
double x , y ;
};
puncte q [ MAX ] ;
double sol ;
int main( )
{
int n ;
fin >> n ;
for ( int i = 1 ; i <= n ; ++ i )
fin >> q [ i ].x >> q[ i ].y ;
q [ 0 ] = q [ n ] ;
for ( int i = 0 ; i < n ; ++ i )
sol = sol + q[i].x*q[i+1].y - q[i+1].x*q[i].y;
fout << fixed << setprecision ( 6 ) << sol / 2.0 << '\n';
return 0;
}