본문 바로가기

Algorithm/Baekjoon

[백준_JAVA] 5597 과제 안 내신 분..?

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] student = new int[31];
		int success;
		
		for(int i = 1; i <= 28; i++) {
			success = sc.nextInt();
			student[success] = 1;
		}

		for(int j = 1; j <= 30; j++) {
			if(student[j] != 1)
			 System.out.println(j);
		}
		
		sc.close();
	}
}

 

'Algorithm > Baekjoon' 카테고리의 다른 글

[백준_JAVA] 1085 직사각형에서 탈출  (0) 2023.08.08
[백준_JAVA] 5086 배수와 약수  (0) 2023.08.07
[백준_JAVA] 10813 공 바꾸기  (0) 2023.08.05
[백준_JAVA] 10810 공 넣기  (0) 2023.08.03
[백준_JAVA] 2562 최댓값  (0) 2023.08.02