-
[java]백준 최소, 최대 10818번알고리즘 문제풀이/백준(자바) 2023. 3. 25. 20:19
코드
import java.util.Arrays; import java.util.Scanner; public class BOJ_10818 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a = in.nextInt(); int[] q = new int[a]; for(int i=0; i<a; i++){ q[i]=in.nextInt(); } Arrays.sort(q); System.out.println(q[0]+" "+q[a-1]); in.close(); } }
링크
https://www.acmicpc.net/problem/10818
'알고리즘 문제풀이 > 백준(자바)' 카테고리의 다른 글
[java]백준 문자와 문자열 27866번 (0) 2023.03.26 [java]백준 곱셈 2588번 (0) 2023.03.25 [java]백준 기찍 N 2742번 (0) 2023.03.24 [java]백준 N 찍기 2741번 (0) 2023.03.24 [java]백준 A+B - 2 2558번 (0) 2023.03.24