백준 3003 킹, 퀸, 룩, 비숍, 나이트, 폰 C#
using System; namespace ChessSet{ class Chess{ static void Main(){ string[] input = Console.ReadLine().Split(); int[] w = {1, 1, 2, 2, 2, 8}; for(int i = 0; i < input.Length; i++){ w[i] -= int.Parse(input[i]); } foreach(int j in w) Console.Write(j.ToString() + " "); } } } https://www.acmicpc.net/problem/3003 3003번: 킹, 퀸, 룩, 비숍, 나이트, 폰 첫째 줄에 동혁이가 찾은 흰색 킹, 퀸, 룩, 비숍, 나이트, 폰의 개수가 주어진다. 이 값은 0보다 크거나 ..
2023. 9. 16.
백준 3003 킹, 퀸, 룩, 비숍, 나이트, 폰 python
#---1---배열 비교 chess = [1, 1, 2, 2, 2, 8] a = list(map(int, input().split())) for i in range(len(a)): chess[i] -= a[i] for i in range(len(chess)): print(chess[i], end = ' ') #---2---노가다(?) a = list(map(int, input().split())) a[0] = 1 - a[0] a[1] = 1 - a[1] a[2] = 2 - a[2] a[3] = 2 - a[3] a[4] = 2 - a[4] a[5] = 8 - a[5] for i in range(len(a)): print(a[i], end = ' ') https://www.acmicpc.net/problem..
2023. 9. 16.