konevLOX

Untitled

Nov 13th, 2019
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1.         static double Square(int a, int b, int c)
  2.         {
  3.             double p = (a + b + c) / 2;
  4.             double s = Math.Sqrt(p * (p - a) * (p - b) * (p - c));
  5.             return s;
  6.         }
  7.         static double Data()
  8.         {
  9.             WriteLine("Стороны треугольника");
  10.             int a = int.Parse(ReadLine());
  11.             int b = int.Parse(ReadLine());
  12.             int c = int.Parse(ReadLine());
  13.             double S = Square(a, b, c);
  14.             return S;
  15.         }
  16.         static void Main(string[] args)
  17.         {
  18.             double S1 = Data();
  19.             double S2 = Data();
  20.             if (S1 > S2)
  21.                 WriteLine(S1);
  22.             else
  23.                 WriteLine(S2);
  24.         }
Add Comment
Please, Sign In to add comment