HDACM 1859
求最大值和最小值,水题
import java.util.Scanner;public class Main{public static void main(String[] args) {Scanner sc = new Scanner(System.in);while(sc.hasNext()){int x = sc.nextInt();int y = sc.nextInt();int min_x = x;int min_y = y;int max_x = x;int max_y = y;if (min_x == 0 && min_y == 0) {break;}while (true) {x = sc.nextInt();y = sc.nextInt();if (x==0 && y==0) {break;}if (x>max_x) {max_x = x;}if (y>max_y) {max_y = y;}if (x<min_x) {min_x = x;}if (y<min_y) {min_y = y;}}System.out.println(min_x+" "+min_y+" "+max_x+" "+max_y);}sc.close();}
}