package com.java.test;
import java.util.Scanner;
public class Test3 {
public static void main(String[] args) {
int [] x=new int [5];
int max=x[0];
int min=x[0];
int i;
System.out.println("请输入五个数到数组中");
Scanner in=new Scanner(System.in);
for(i=0;i<5;i++) {
x[i]=in.nextInt();
if(min>x[i]) {
min=x[i];
}
if(max<x[i]) {
max=x[i];
}
}
System.out.println("最大值是"+max);
System.out.println("最小值是"+min);
}
}