-
[java]백준 과제 안 내신 분..? 5597번알고리즘 문제풀이/백준(자바) 2023. 5. 19. 21:38
코드
import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; public class BOJ_5597 { public static int[] removeDuplicates(int[] arr) { return Arrays.stream(arr).distinct().toArray(); } public static void main(String[] args) { Scanner in = new Scanner(System.in); List<Integer> a=new ArrayList<Integer>(); List<Integer> b=new ArrayList<Integer>(); for (int i = 0; i < 28; i++) { a.add(in.nextInt()); } for (int i = 1; i < 31; i++) { b.add(i); } b.removeAll(a); for (Integer integer : b) { System.out.println(integer); } in.close(); } }
링크
https://www.acmicpc.net/problem/5597
'알고리즘 문제풀이 > 백준(자바)' 카테고리의 다른 글
[java]백준 공 넣기 10810번 (1) 2023.05.21 [java]백준 문자열 반복 2675번 (0) 2023.05.20 [java]백준 자동완성 24883번 (0) 2023.05.18 [java]백준 심부름 가는 길 5554번 (0) 2023.05.17 [java]백준 마이크로소프트 로고 5338번 (0) 2023.05.16