package Day1;
import java.util.Scanner;
public class Example_01 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int count = scan.nextInt();
int numList[]= new int[count];
int max = numList[0];
int min = numList[0];
for(int i=1; i<count; i++) {
numList[i] = scan.nextInt();
if ( numList[i] < min) {
min = numList[i];
}
if ( numList[i] > max) {
max = numList[i];
}
}
System.out.print(min + " " + max);
}
}
여러분 뭐가 문제일까요 ,,,, 함께 생각해주세요 ,,, 아무리 봐도 저는 문제점이 안보여요 ..
근데 실행시켜보면
이렇게 나온답니다..!
혹시 코딩 천재들 발견하시면 말씀해주시옵소서
'Coding Test' 카테고리의 다른 글
#2562 최댓값 구하기 JAVA (0) | 2021.03.30 |
---|---|
#1152 단어의 개수 JAVA (0) | 2021.03.30 |
#10952 A+B-5 (0) | 2021.01.28 |
#2438 별찍기 (0) | 2021.01.28 |
#11021, #10871 [JAVA] (0) | 2021.01.27 |