#include
#include
int main()
{
int control,row1,column1,row2,column2,i1,j1,i2,j2,i3,j3;
control=0;
while(control==0)
{
printf("please input the number of the first matrix's rows\n");
scanf("%d",&row1);
printf("please input the number of the first matrix's columns\n"); scanf("%d",&column1);
printf("please input the number of the second matrix's rows\n"); scanf("%d",&row2);
printf("please input the number of the second matrix's columns\n"); scanf("%d",&column2);
if(column1!=row2)
{
printf("error!please input again\n");
control=0;
}
else
{
control=1;
}
}
int matrix1[row1][column1],matrix2[row2][column2],matrix3[row1][column2]; for(i1=0;i1
{
for(j1=0;j1
{
printf("please input the %d ,%d element of the first matrix\n",i1,j1); scanf("%d",&matrix1[i1][j1]);
}
}
for(i2=0;i2
{
for(j2=0;j2
{
printf("please input the %d ,%d element of the second matrix\n",i2,j2); scanf("%d",&matrix2[i2][j2]);
}
}