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.Tasks;
- namespace Triangle
- {
- class Triangle
- {
- 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());
- double a = (double)Math.Sqrt(((bx - ax) * (bx - ax)) + ((by - ay) * (by - ay)));
- double b = (double)Math.Sqrt(((cx - bx) * (cx - bx)) + ((cy - by) * (cy - by)));
- double c = (double)Math.Sqrt(((cx - ax) * (cx - ax)) + ((cy - ay) * (cy - ay)));
- double p = (a + b + c) / 2;
- double area = Math.Sqrt(p * (p - a) * (p - b) * (p - c));
- if (a + b > c && b + c > a && a + c > b)
- {
- Console.WriteLine("Yes");
- Console.WriteLine("{0:0.00}", area);
- }
- else
- {
- Console.WriteLine("No");
- Console.WriteLine("{0:0.00}", a);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment