package judgment;
import java.util.Scanner;
/**
* 用户输入n个整数,找出最大值和最小值并打印输出
*/
public class Judgment {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
System.out.println("请输入第一个整数");
int max= input.nextInt();
int min=max;
for (int i = 2; i < 9; i++) {
System.out.println("第"+i+"位整数为");
int num=input.nextInt();
if (num>max){
max=num;
}
if (num<min){
min=num;
}
}
System.out.println("最大值为"+max);
System.out.println("最小值为"+min);
}
}