import java.util.*;
class Test1 {
public static void main(String[] args){
int[] a = {1,3,7,4,4,3,2};
int[] b = {1,3,5,4,4,3,2};
ceshi(a);
ceshi(b);
}
public static void ceshi(int[] a){
Arrays.sort(a);
int min = a[0];
int max = a[a.length-1];
if((max-min)>a.length){
System.out.println("不能组成连续的数字。");
return;
}
else
{
for(int x = 0;x<a.length-1;x++)
{
int first = (int)a[x];//这里为什么要int强转 我去掉int也能运行
int second = (int)a[x+1];
if(first != second){
if((first+1) != second){
System.out.println("不能组成连续的数字。");
return;
}
}
}
}
}