using System;
class Program
{
static void Main(string[] args)
{
int[] chess = new int[6] { 1, 1, 2, 2, 2, 8 };
string line = Console.ReadLine();
string[] array = line.Split(' ', StringSplitOptions.None);
//char[] array = line.ToCharArray(0, line.Length);
int[] intArray = new int[array.Length];
for (int i = 0; i < array.Length; i++)
{
intArray[i] = System.Convert.ToInt32(array[i]);
}
int[] result = new int[intArray.Length];
for (int i = 0; i < intArray.Length; i++)
{
result[i] = chess[i] - intArray[i];
}
for (int i = 0; i < result.Length; i++)
{
Console.Write(result[i] + " ");
}
}
}
문제 출처
https://www.acmicpc.net/problem/3003
3003번: 킹, 퀸, 룩, 비숍, 나이트, 폰
첫째 줄에 동혁이가 찾은 흰색 킹, 퀸, 룩, 비숍, 나이트, 폰의 개수가 주어진다. 이 값은 0보다 크거나 같고 10보다 작거나 같은 정수이다.
www.acmicpc.net
'ComputerScience > Coding Test' 카테고리의 다른 글
백준 1546번: 평균 (0) | 2022.11.10 |
---|---|
백준 10807번: 개수 세기 (0) | 2022.11.10 |
백준 5597번: 과제 안 내신 분..? (0) | 2022.11.10 |
백준 25304번: 영수증 (0) | 2022.11.10 |
백준 브론즈 1.. 아직 멀었다. (0) | 2022.04.16 |