数组a包括十个整数元素从a中第二个元素起分别将后项减前项之差寸入数组b并按照每行三个元素输出b

2024-11-30 20:23:36
推荐回答(2个)
回答(1):

看不懂,直接问老师

回答(2):

public class test{
static int[] qiuCha(int[] a){
int[] b = new int[a.length - 1];
for(int i=0 ,n = 1; i b[i] = a[n] - a[i];
}
return b;
}
public static void main(String[] args){
int [] a = {1,20,3,44,50,36,17,80,92,10};
int[] b = qiuCha(a);
for(int i=0; i if( (i+1) % 3 == 0) System.out.println();
System.out.print(b[i] + " ");
}
}
}