C语言矩阵乘法程序填空

来源:百度知道 编辑:UC知道 时间:2024/05/18 09:00:36
#include “stdio.h”
main()
{int i,j,k, c[2][3];
________ int a[2][4]={1,2,3,4,5,6,7,8};
________int b[4][3]={1,2,3,4,5,6,7,8,9,10,11,12};
for(i=0; i<2;i++)
for(j=0;j<3; j++)
{c[i][j]=________;
for(k=0;k<4;k++)
c[i][j]=________________________;
}
for (i=0;i<2;i++)
for(j=0;j<3;j++)
printf(“%6d”,c[i][j]);
printf(“\n”);
}
}

怎么感觉空好多呀~!其实下面的程序就可以了~!
#include “stdio.h”
main()
{int i,j,k, c[2][3];
int a[2][4]={1,2,3,4,5,6,7,8};
int b[4][3]={1,2,3,4,5,6,7,8,9,10,11,12};
for(i=0; i<2;i++)
for(j=0;j<3; j++)
{c[i][j]=__0______;
for(k=0;k<4;k++)
c[i][j]=a[i][k]*b[k][j]+c[i][j];
}
for (i=0;i<2;i++)
for(j=0;j<3;j++)
printf(“%6d”,c[i][j]);
printf(“\n”);

}

1.static
2.static
3.0
4.a[i][j]*b[i][j]+c[i][j]

前两个空确实有吗?