public static void main(String[] args) {
int[] ints = {0,4,2,1,3,5,6,7,8,9,10,15,12,14,13,17,18,19,20,22,23};
Arrays.sort(ints);
System.out.println(Arrays.toString(ints));
int com = 0;
int once = 0;
int[] pc = new int[3];
for(int i = 0; i < ints.length; i++){
if(com++ != ints[i]){
pc[once] = i + once;
once++;
com++;
}
}
System.out.println(Arrays.toString(pc));
}
挑选缺少的连续数字
最新推荐文章于 2022-12-29 19:59:34 发布