Guest User

Untitled

a guest
Mar 17th, 2016
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1.  
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Problem2TriangleArea {
  6. public static void main(String[] args) {
  7. Scanner console = new Scanner(System.in);
  8. int aX = console.nextInt();
  9. int aY = console.nextInt();
  10. int bX = console.nextInt();
  11. int bY = console.nextInt();
  12. int cX = console.nextInt();
  13. int cY = console.nextInt();
  14.  
  15. int result = (aX * (bY - cY) + bX * (cY - aY) + cX * (aY - bY)) / 2;
  16. System.out.println(Math.abs(result));
  17. }
  18. }
Add Comment
Please, Sign In to add comment