Advertisement
kallyy7

Untitled

Mar 3rd, 2018
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.24 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace seg
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int a = int.Parse(Console.ReadLine());
  14.             int b = int.Parse(Console.ReadLine());
  15.             int c = int.Parse(Console.ReadLine());
  16.             int min = int.MaxValue;
  17.             int max = int.MinValue;
  18.             int av = a + b + c;
  19.             if (a < min)
  20.             {
  21.                 min = a;
  22.             }
  23.             if (b < a)
  24.             {
  25.                 min = b;
  26.             }
  27.             if (c < b)
  28.             {
  29.                 min = c;
  30.                 if (a < c)
  31.                 {
  32.                     min = a;
  33.                 }
  34.             }
  35.             if (a > max)
  36.             {
  37.                 max = a;
  38.             }
  39.             if (b > a)
  40.             {
  41.                 max = b;
  42.             }
  43.             if (c > b)
  44.             {
  45.                 max = c;
  46.                 if (a > c)
  47.                 {
  48.                     max = a;
  49.                 }
  50.             }
  51.             av = av - (min + max);
  52.             Console.WriteLine($"{min} {av} {max}");
  53.         }
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement