![](https://img-blog.csdnimg.cn/img_convert/1e33b3e9d8aef2d521678c67acc2b9c7.png)
java两个矩阵相乘
import java.util.Scanner; //import Scanner class in our program
class demo
{
public static void main(String…s)
{
int i,j,m,n,p,q,k;
Scanner sc=new Scanner(System.in); //used to read from keyboard
System.out.print(“Enter number of rows and columns of first matrix:”);
m=sc.nextInt();
n=sc.nextInt();
System.out.print(“Enter number of rows and columns of second matrix:”);
p=sc.nextInt();
q=sc.nextInt();
if(n!=p)
System.ou