1 回答
已采纳
慕粉15160033427
TA贡献2条经验 获得超1个赞
package answear;
public class Inter {
public static void main(String[] args) {
int[][] a = {{2,3,4},{4,6,8}};
int[][] b = {{1,5,2,8},{5,9,10,-3},{2,7,-5,-18}};
int[][] c = new int[2][4];
System.out.println("生成的新数组c是:");
for(int i=0; i<2; i++){
for(int j=0; j<4; j++){
int temp = 0;
for(int k=0; k<3; k++){
temp += a[i][k]*b[k][j];
}
c[i][j] = temp;
System.out.print(c[i][j]+" ");
}
System.out.println();
}
}
}
添加回答
举报
0/150
提交
取消