两个矩阵a 和b 的乘积,结果为c 矩阵,求c 语言程序!

来源:百度知道 编辑:UC知道 时间:2024/05/18 08:18:23
很急!谢谢了

给,已经编译运行确认:
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#define X 3 //这里是矩阵的参数,可以自己定义,现在暂定的3*3矩阵
#define Y 3 //这里是矩阵的参数,可以自己定义,现在暂定的3*3矩阵

int a[X][Y];
int b[X][Y];
int c[X][Y];

void matrix(int b[][X],int c[][Y]);

main()
{
int i,j,temp;

printf("Please input int matrix b[%d][%d]\n",X,Y);
for(i=0;i<Y;i++)
for(j=0;j<Y;j++){
scanf("%d",&temp);
b[i][j]=temp;
}
printf("Please input int matrix c[%d][%d]\n",X,Y);
for(i=0;i<X;i++)
for(j=0;j<Y;j++){
scanf("%d",&temp);
c[i][j]=temp;
}
matrix(b,c);
printf("Now print resource matrix b[%d][%d]=",X,Y);
for(i=0;i<X;i++){
printf("\n");
for(j=0;j<Y;j++)
printf("%d ",b[i][j]);
}
printf("\n");
printf("Now print resour