第八章第六题(代数:两个矩阵相乘的方法)(Algebra: a method of multiplying two matrices)
*8.6(代数:两个矩阵相乘的方法)编写两个矩阵相乘的方法。方法头如下: public static double[][] multiplyMatrix(double[][] a,double[][] b) 编写一个测试程序,提示用户输入两个3x3的矩阵,然后显示他们的乘积。
*8.6(Algebra: a method of multiplying two matrices)Write the method of multiplying two matrices. The method header is as follows: public static double[][] multiplyMatrix(double[][] a,double[][] b) Write a test program, prompt the user to input two 3x3 matrices, and then display their product.
参考代码:
package chapter08;import java.util.Scanner;publicclassCode_06{
publicstaticvoidmain(String[] args){
Scanner input =newScanner(System.in);
System.out.print("Enter matrix1: ");double[][] a =newdouble[3][3];for(int i =0; i <3; i++){
for(int j =0; j <3; j++){
a[i][j]= input.nextDouble();}}
System.out.print("Enter matrix2: ");double[]
第八章第六题(代数:两个矩阵相乘的方法)(Algebra: a method of multiplying two matrices)
第八章第六题(代数:两个矩阵相乘的方法)(Algebra: a method of multiplying two matrices)*8.6(代数:两个矩阵相乘的方法)编写两个矩阵相乘的方法。方法头如下:public static double[][]multiplyMatrix(double[][] a,double[][] b)编写一个测试程序,提示用户输入两个3x3的矩阵,然后显示他们的乘积。*8.6(Algebra: a method of multiplying two matric