Pagini recente » Cod sursa (job #1860209) | Cod sursa (job #1219423) | Cod sursa (job #1474509) | Cod sursa (job #2959576) | Cod sursa (job #948300)
Cod sursa(job #948300)
var n,i:longint;
f1,f2,y1,y2,x1,x2,s:real;
begin
assign(input,'aria.in'); reset(input);
assign(output,'aria.out'); rewrite(Output);
readln(n); s := 0;
readln(f1,f2);
x1 := f1; y1 := f2;
for i := 2 to n do
begin
readln(x2,y2);
s := s + (x1*y2-x2*y1) / 2;
x1 := x2;
y1 := y2;
end;
x2 := f1; y2 := f2;
s := s + (x1*y2-x2*y1) / 2;
if s < 0 then s := s * -1;
writeln(s);
close(input);
close(output);
end.