코테/백준
백준 3003 JAVA
Slow Motion~
2022. 12. 22. 12:38
728x90
import java.util.Scanner;
/*
* 첫째 줄에 입력에서 주어진 순서대로 몇 개의 피스를 더하거나 빼야 되는지를 출력한다.
* 만약 수가 양수라면 동혁이는 그 개수 만큼 피스를 더해야 하는 것이고, 음수라면 제거해야 하는 것이다.*/
public class Main {
public static void main(String[] args) {
Scanner cs = new Scanner(System.in);
int king = 1;
int queen = 1;
int rook = 2;
int bishop = 2;
int knight = 2;
int pawn = 8;
king = king - cs.nextInt();
queen = queen - cs.nextInt();
rook = rook - cs.nextInt();
bishop = bishop - cs.nextInt();
knight = knight - cs.nextInt();
pawn = pawn - cs.nextInt();
// 띄어쓰기 안해서 실패
// System.out.print(king);
// System.out.print(queen);
// System.out.print(rook);
// System.out.print(bishop);
// System.out.print(knight);
// System.out.print(pawn);
System.out.print(king + " ");
System.out.print(queen + " ");
System.out.print(rook + " ");
System.out.print(bishop + " ");
System.out.print(knight + " ");
System.out.print(pawn);
}
}