#include<stdio.h>
void input_matrix(int *matrix,int r,int c);
int main(void)
{
int r,c;
printf("enter the rows of the matrix:");
scanf("%d",&r);
printf("enter the columns of the matrix:");
scanf("%d",&c);
int matrix1[r][c]={0},matrix2[c][r]={0};
input_matrix(*matrix1,r,c);
for(int i=0;i<r;i++)
{
for(int j=0;j<c;j++)
{
printf("%d ",matrix1[i][j]);
}
printf("\n");
}
}
void input_matrix(int *matrix,int r,int c)
{
int i,j;
for(i=0;i<r;i++)
for(j=0;j<c;j++)
scanf("%d",matrix[i][j]);
}
找一下问题找一下问题
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-