MapleStory Finger Point

๐Ÿƒ‍โ™‚๏ธBaekjoon/Java

[10818/JAVA] ์ตœ์†Œ, ์ตœ๋Œ€

HYEJU01 2021. 9. 9. 03:04
import java.util.Scanner;

public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int N;
int min = 1000001;
int max = -1000001;

N = sc.nextInt();
int[] arr = new int[N];

for (int i=0; i<N; i++) {
arr[i] = sc.nextInt(); 

if (arr[i] < min )
min = arr[i];
if (arr[i] > max)
max = arr[i];
}


System.out.printf(min + " " + max);





sc.close();
}
}