-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbj5597.java
More file actions
40 lines (36 loc) · 1.04 KB
/
bj5597.java
File metadata and controls
40 lines (36 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package array;
import java.util.HashSet;
import java.util.Scanner;
public class Bj5597 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
HashSet<Integer> students = new HashSet<>();
// 28명의 제출자 입력받기
for (int i = 0; i < 28; i++) {
int n = sc.nextInt();
students.add(n);
}
sc.close();
// 모든 출석번호 중 제출하지 않은 번호 찾기
for (int i = 1; i <= 30; i++) {
if (!students.contains(i)) {
System.out.println(i);
}
}
}
// public static void main(String[] args) {
// Scanner sc = new Scanner(System.in);
// int[] arr = new int[30];
//
// for (int i = 0; i < 28; i++) {
// int success = sc.nextInt();
// arr[success - 1] = 1;
// }
//
// for (int i = 0; i < arr.length; i++) {
// if (arr[i] != 1) {
// System.out.println(i + 1);
// }
// }
// }
}