public class 数组 { public static void main(String[] args) { int[] a={12,43,72,64,24,58,95,36}; int[] b=new int[a.length+1]; int index=4; for (int i=0;i<a.length;i++){ b[i]=a[i]; } b[index]=999; for (int i=0;i<index; i++){ b[i]=a[i]; } a=b; System.out.println(Arrays.toString(b)); System.out.println(Arrays.toString(a)); System.out.println(); } }
初级程序员
by: lc111111 发表于:2023-12-05 10:43:11 顶(0) | 踩(0) 回复
答辩
回复评论