Advertisement
fbinnzhivko

Triangle Area

Mar 16th, 2016
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         int x1 = int.Parse(Console.ReadLine());
  7.         int y1 = int.Parse(Console.ReadLine());
  8.         int x2 = int.Parse(Console.ReadLine());
  9.         int y2 = int.Parse(Console.ReadLine());
  10.         int x3 = int.Parse(Console.ReadLine());
  11.         int y3 = int.Parse(Console.ReadLine());
  12.        
  13.         int a = Math.Abs(x2 - x3);
  14.         //Console.WriteLine(a);
  15.         int h = Math.Abs(y1 - y3);
  16.         //Console.WriteLine(h);
  17.  
  18.         Console.WriteLine("{0:0.0}",(a*h)/2.0);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement