- 문제풀이
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] nums = sc.nextLine().split(" ");
int max = -1000;
int min = 1000;
for(int i = 0 ; i < nums.length ; i++) {
if(Integer.parseInt(nums[i]) == -999) {
break;
}
max = Math.max(max, Integer.parseInt(nums[i]));
min = Math.min(min, Integer.parseInt(nums[i]));
}
System.out.println(max + " " + min);
}
}