package com.poi.importxls;
import java.util.Arrays;
import java.util.Scanner;
public class ScannerDemo {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in) ;
int[] a = new int[5];
for (int i = 0; i < 5; i++) {
int b = scanner.nextInt();
a[i] = b;
}
Arrays.sort(a);
System.out.println("最小值:"+a[0]+"最大值:"+a[4]);
scanner.close();
}
java SCanner获取数组内容。
最新推荐文章于 2024-10-04 18:26:31 发布