KlimentHristov

01.A-B-C

Nov 11th, 2015
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. using System;
  2. class ABC
  3. {
  4.     static void Main()
  5.     {
  6.         decimal a = decimal.Parse(Console.ReadLine());
  7.         decimal b = decimal.Parse(Console.ReadLine());
  8.         decimal c = decimal.Parse(Console.ReadLine());
  9.  
  10.         if (Math.Max(a,b) > c)
  11.         {
  12.             Console.WriteLine(Math.Max(a,b));  
  13.         }
  14.         else
  15.         {
  16.             Console.WriteLine(c);
  17.         }
  18.  
  19.         if (Math.Min(a,b)<c)
  20.         {
  21.             Console.WriteLine(Math.Min(a,b));
  22.         }
  23.         else
  24.         {
  25.             Console.WriteLine(c);
  26.         }
  27.         decimal resultAll = (a + b + c) / 3;
  28.         Console.WriteLine("{0:F3}",resultAll);
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment