c语言写简单的矩阵,c语言_实现简单矩阵相乘

#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]);

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值