#include<stdio.h>
#include<string.h>
#define MAX_VAL 100
//Function declaration
int input_values(int Z[][k], int j, int k);
int main(void)
{
int A(int [ ][k], int, int);
int m, n;
char comm[100];
while(1){
printf("\n>>");
gets(comm);
if(strcmp(comm,"MAKE A")== 0)
input_values(A, j, k );
}
}
//make or overwrite matrix
int input_values(int Z[][k], int j, int k)
{
int row, col;
//DETERMINING THE SIZE OF MATRIX
do{
printf("Enter the number of rows: ");
scanf("%d", &row);
if(row>100)
printf("Size is out of bounds! Size must be less than or equal to 100\n");
}while(row>100);
do{
printf("Enter the number of columns: ");
scanf("%d", &col);
if(col>100)
printf("Size is out of bounds! Size must be less than or equal to 100\n");
}while(col>100);
//ENTERING THE VALUES OF MATRIX
for(j=0; j<row; j++)
for(k=0; k<col; k++){
printf("A[%d][%d] = ", j, k);
scanf("%d", &Z[j][k]);
}
return Z[][];
}
问问题
204 次