Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Console.WriteLine("Task: I_2");
- static double S(double a, double b, double c)
- {
- double p = (a + b + c) / 2;
- return Math.Sqrt(p * (p - a) * (p - b) * (p - c));
- }
- Console.Write("double a1 = "); double a1 = double.Parse(Console.ReadLine()!);
- Console.Write("double b1 = "); double b1 = double.Parse(Console.ReadLine()!);
- Console.Write("double c1 = "); double c1 = double.Parse(Console.ReadLine()!);
- Console.Write("double a2 = "); double a2 = double.Parse(Console.ReadLine()!);
- Console.Write("double b2 = "); double b2 = double.Parse(Console.ReadLine()!);
- Console.Write("double c2 = "); double c2 = double.Parse(Console.ReadLine()!);
- double s1 = S(a1, b1, c1), s2 = S(a2, b2, c2);
- string c = s1 > s2 ? ">" : (s1 < s2 ? "<" : "==");
- Console.WriteLine("S1 = {0} " + c + " S2 = {1}", s1, s2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement