λ°μν
import java.util.Arrays;
import java.util.Scanner;
public class Main {
// 10818 μ΅μ, μ΅λ
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] nArr = new int[n];
for (int i=0; i<n; i++) {
nArr[i] = sc.nextInt();
}
sc.close();
Arrays.sort(nArr);
System.out.printf("%d %d", nArr[0], nArr[n-1]);
}
}
λ°μν
'πΈ Algorithm > πΈ λ°±μ€ BaekJoon' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[λ°±μ€][java][10810][곡 λ£κΈ°] (1) | 2023.10.22 |
---|---|
[λ°±μ€][java][2562][μ΅λκ°] (0) | 2023.10.15 |
[λ°±μ€][java][10871][Xλ³΄λ€ μμ μ] (0) | 2023.10.15 |
[λ°±μ€][java][10807][κ°μ μΈκΈ°] (0) | 2023.10.15 |
[λ°±μ€][java][10951][A+B - 4] (0) | 2023.10.09 |