백준 3003 c++

magicdrill·2024년 3월 16일
0

백준 문제풀이

목록 보기
162/655

백준 3003 c++

#include <iostream>
#include <cstdlib>

using namespace std;

int main(void)
{
	int correct_chess[6] = {1, 1, 2, 2, 2, 8};
	int white[6];
	int i;
	
	for (i = 0; i < 6; i++)
	{
		cin >> white[i];
		if (white[i] >= 0 && white[i] <= 10)
		{
			white[i] = correct_chess[i] - white[i];
		}
		else
		{
			break;
		}
	}
	for (i = 0; i < 6; i++)
	{
		cout << white[i] << " ";
	}
	cout << endl;

	return 0;
}

0개의 댓글