문제 링크입니다: www.acmicpc.net/problem/3003
3003번: 킹, 퀸, 룩, 비숍, 나이트, 폰
첫째 줄에 동혁이가 찾은 흰색 킹, 퀸, 룩, 비숍, 나이트, 폰의 개수가 주어진다. 이 값은 0보다 크거나 같고 10보다 작거나 같은 정수이다.
www.acmicpc.net
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
const int MAX = 6; | |
int properChessPieces[MAX] = { 1, 1, 2, 2, 2, 8 }; | |
int main(void) | |
{ | |
ios_base::sync_with_stdio(0); | |
cin.tie(0); | |
for (int i = 0; i < MAX; i++) | |
{ | |
int cnt; | |
cin >> cnt; | |
cout << properChessPieces[i] - cnt << " "; | |
} | |
cout << "\n"; | |
return 0; | |
} |


개발환경:Visual Studio 2017
지적, 조언, 질문 환영입니다! 댓글 남겨주세요~
반응형
'알고리즘 > BOJ' 카테고리의 다른 글
백준 5522번 카드 게임 (0) | 2021.03.06 |
---|---|
백준 3046번 R2 (0) | 2021.03.06 |
백준 2914번 저작권 (0) | 2021.03.05 |
백준 2845번 파티가 끝나고 난 뒤 (0) | 2021.03.05 |
[KOI 초등부] 백준 2475번 검증수 (0) | 2021.03.05 |