umilove98의 블로그

백준 3003 Java 본문

algorithm/백준

백준 3003 Java

umilove98 2021. 7. 17. 19:51
반응형

import java.io.*;
import java.util.*;


public class Q3003 {

	public static void main(String[] args) throws IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String s = bf.readLine();
		StringTokenizer st = new StringTokenizer(s);
		ArrayList<Integer> chess = new ArrayList<Integer>();
		for (int i = 0; i < 6; i++) { 
			chess.add(Integer.parseInt(st.nextToken()));
		}	
		ArrayList<Integer> stdchess = new ArrayList<Integer>(Arrays.asList(1,1,2,2,2,8)); //체스말의 기본 갯수
		
		for (int i = 0; i < 6; i++) {
			int result;
			result = stdchess.get(i) - chess.get(i); 
			System.out.print(result+" ");
		}

	}

}
반응형

'algorithm > 백준' 카테고리의 다른 글

백준 5522 Java  (0) 2021.07.17
백준 3046 Java  (0) 2021.07.17
백준 2914 Java  (0) 2021.07.17
백준 2845 Java  (0) 2021.07.17
백준 2475 Java  (0) 2021.07.17