bor

3A : Площадь треугольника

bor
Jan 3rd, 2013
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.34 KB | None | 0 0
  1. program _3A;
  2.  
  3. type
  4.   Point = record
  5.     x, y : Int64;
  6.   end;
  7.  
  8. var
  9.   a, b, c, ab, ac : Point;
  10.   s : Int64;
  11.  
  12. begin
  13.   ReadLn(a.x, a.y);
  14.   ReadLn(b.x, b.y);
  15.   ReadLn(c.x, c.y);
  16.   ab.x := b.x - a.x;
  17.   ab.y := b.y - a.y;
  18.   ac.x := c.x - a.x;
  19.   ac.y := c.y - a.y;
  20.   s := ab.x * ac.y - ab.y * ac.x;
  21.   s := abs(s);
  22.   WriteLn(s / 2);
  23. end.
Advertisement
Add Comment
Please, Sign In to add comment