문제링크
https://www.acmicpc.net/problem/3003
3003번: 킹, 퀸, 룩, 비숍, 나이트, 폰
첫째 줄에 동혁이가 찾은 흰색 킹, 퀸, 룩, 비숍, 나이트, 폰의 개수가 주어진다. 이 값은 0보다 크거나 같고 10보다 작거나 같은 정수이다.
www.acmicpc.net
나의코드
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int king = 1; int queen = 1; int rook = 2; int bishop =2; int knight = 2; int pawn = 8; System.out.print(king - sc.nextInt()+ " "); System.out.print(queen - sc.nextInt()+ " "); System.out.print(rook - sc.nextInt()+ " "); System.out.print(bishop - sc.nextInt()+ " "); System.out.print(knight - sc.nextInt()+ " "); System.out.print(pawn - sc.nextInt()); sc.close(); } }
'Baekjoon Online Judge' 카테고리의 다른 글
[BOJ] 백준 2588번 곱셈 (Java) (0) | 2022.11.12 |
---|---|
[BOJ] 백준 10430번 나머지 (Java) (0) | 2022.11.11 |
[BOJ] 백준 18108번 1998년생인 내가 태국에서는 2541년생?! (Java) (0) | 2022.11.09 |
[BOJ] 백준 10926번 ??! (Java) (0) | 2022.11.08 |
[BOJ] 백준 10869번 사칙연산 (Java) (0) | 2022.11.07 |
댓글