백준 10817번

Console(콘솔)/알고리즘 2019. 9. 27. 11:32

using System;

 

 

namespace Syntax12

{

    class Program

    {

        static void Main(string[] args)

        {

            string arr = Console.ReadLine();

            string[] art = arr.Split(' ');

            int a = int.Parse(art[0].ToString());

            int b = int.Parse(art[1].ToString());

            int c = int.Parse(art[2].ToString());

 

            bool A = a >= b && a >= c && b >= c;

            bool B = c >= b && c >= a && b >= a;

            bool C = b >= a && b >= c && a >= c;

            bool D = c >= a && c >= b && a >= b;

            bool E = a >= c && a >= b && c >= b;

            bool F = b >= c && b >= a && c >= a;

            if (A)

            {

                Console.WriteLine(b);

            }

            else if (B)

            {

                Console.WriteLine(b);

            }

            else if (C)

            {

                Console.WriteLine(a);

            }

            else if (D)

            {

                Console.WriteLine(a);

            }

            else if (E)

            {

                Console.WriteLine(c);

            }

            else if (F)

            {

                Console.WriteLine(c);

            }

 

 

        }

    }

}

 

 

Colored by Color Scripter

'Console(콘솔) > 알고리즘' 카테고리의 다른 글

백준 10171번  (0) 2019.09.27
백준 2739번  (0) 2019.09.27
백준 1330번  (0) 2019.09.27
백준 1110번  (0) 2019.09.27
백준 10951번  (0) 2019.09.26
: