소소한개발팁
반응형
article thumbnail
[정렬]2587번 대표값2
알고리즘/백준 2023. 6. 12. 22:56

출처 : https://www.acmicpc.net/problem/2587 Problem Code import java.util.Scanner; import java.util.Arrays; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] Nl = new int[5]; int count = 0; for (int i = 0; i < 5; i++) { int N = sc.nextInt(); count += N; Nl[i] = N; } Arrays.sort(Nl); StringBuilder sb = new StringBuilder(); sb.append(count / 5 + ..

article thumbnail
[정렬]2750번 수 정렬하기
알고리즘/백준 2023. 6. 11. 23:56

출처 : https://www.acmicpc.net/problem/2750 Problem Code import java.io.*; import java.util.Arrays; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); int[] nList = new int[N]; for (int i = 0; i < nList.length; i++) nList[i] = Integer.parseInt(br.readLine(..

반응형