백준/C#

[C#] 백준 3003번 : 킹, 퀸, 룩, 비숍, 나이트, 폰

joungdev 2025. 2. 6. 16:20

[C#] 백준 3003번 : 킹, 퀸, 룩, 비숍, 나이트, 폰

using System;

class Program
{
    static void Main()
    {
        string[] arr = Console.ReadLine().Split(" ");
        string[] chess = new string[] { "1", "1", "2", "2", "2", "8" };

        int remain = 0;
        int[] output = new int[6];

        for (int i = 0; i < arr.Length; i++)
        {
            int a = int.Parse(arr[i]);
            int b = int.Parse(chess[i]);
            
            remain = b - a;
            output[i] = remain;
        }

        for (int j = 0; j < output.Length; j++)
        {
            Console.Write(output[j] + " ");
        }
    }
}

 

반응형