백준/C#

[C#] 백준 2480번 : 주사위 세개

joungdev 2025. 1. 23. 11:33

[C#] 백준 2480번 : 주사위 세개

using System;

class Program
{
    static void Main()
    {
        string num = Console.ReadLine();
        string[] numbers = num.Split(' ');

        int a = int.Parse(numbers[0]);
        int b = int.Parse(numbers[1]);
        int c = int.Parse(numbers[2]);

        if (a == b && b == c)
        {
            Console.WriteLine(10000 + a * 1000);
        } else if ( a == b && b != c )
        {
            Console.WriteLine(1000 + a * 100);
        } else if ( a != b && b == c )
        {
            Console.WriteLine(1000 + b * 100);
        } else if ( a == c && a != b )
        {
            Console.WriteLine(1000 + a * 100);
        }
        else if (a != b && b != c)
        {
            if ( a > b && a > c )
            {
                Console.WriteLine(a * 100);
            } else if ( b > a && b > c ) 
            {
                Console.WriteLine(b * 100);
            } else if ( c > a && c > b )
            {
                Console.WriteLine(c * 100);
            }
        }
    }
}

 

반응형

'백준 > C#' 카테고리의 다른 글

[C#] 백준 10950번 : A+B - 3  (0) 2025.01.23
[C#] 백준 2739번 : 구구단  (0) 2025.01.23
[C#] 백준 2525번 : 오븐 시계  (0) 2025.01.23
[C#] 백준 2884번 : 알람 시계  (0) 2025.01.22
[C#] 백준 14681번 : 사분면 고르기  (1) 2025.01.22