import java.util.Scanner; class NumberException extends Exception{ String xinxi; NumberException(int[] a){ xinxi="请输入整数"; } public String toString(){ return xinxi; } } class ArrayIndexOutOfBoundsException extends Exception{ String xinxi; ArrayIndexOutOfBoundsException(int[] a){ xinxi="请输入至少五个数!"; } public String toString(){ return xinxi; } } class Count{ public void count (int[] a) throws ArrayIndexOutOfBoundsException { if (a.length<5){ ArrayIndexOutOfBoundsException exception=new ArrayIndexOutOfBoundsException(a); throw exception;} System.out.println("个数正确!"); } } public class Test2 { public static void main(String args[]) { Scanner input = new Scanner(System.in); Count cou=new Count(); int b = input.nextInt(); int[] a = new int[b]; for (int i = 0; i < b; i++) { a[i] = input.nextInt(); } } }