亲们,请帮我看看第一题哪错了?
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String nn=sc.nextLine();
if(nn==null||nn.length()==0){
System.out.println(0);
}
int n=new Integer(nn);
if(n==0||n<4||n%2!=0)
System.out.println(0);
String str=sc.nextLine();
String[] strings=str.split(" ");
int[] arr=new int[strings.length];
for(int i=0;i<strings.length;i++){
arr[i]=new Integer(strings[i]);
}
Arrays.sort(arr);
int max=arr[0]+arr[n-1];
int min=arr[n/2-1]+arr[n/2];
System.out.println(max-min);
}