Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading;
- namespace novo2
- {
- class Program
- {
- static void Main(string[] args)
- {
- int aX = int.Parse(Console.ReadLine());
- int aY = int.Parse(Console.ReadLine());
- int bX = int.Parse(Console.ReadLine());
- int bY = int.Parse(Console.ReadLine());
- int cX = int.Parse(Console.ReadLine());
- int cY = int.Parse(Console.ReadLine());
- string n = "No";
- string f = "Yes";
- double a = Math.Sqrt(Math.Pow((cX - bX), 2) - Math.Pow((cY - bY), 2));
- double b = Math.Sqrt(Math.Pow((cX - aX), 2) - Math.Pow((cY - aY), 2));
- double c = (Math.Sqrt(Math.Pow((bX - aX), 2) + Math.Pow((bY - aY), 2)));
- float area = aX * bY + bX * cY + cX * aY - bX * aY - cX * bY - aX * cY;
- if (area == 0)
- {
- Console.WriteLine(n);
- Console.WriteLine("{0:0.00}", c);
- }
- else
- {
- float triangle = area / 2;
- Console.WriteLine(f);
- Console.WriteLine("{0:0.00}", triangle);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment