Hello!
It is necessary to make the parameters for rows and columns entered from the keyboard, and the matrix itself is filled randomly. What is the implementation of the input matrix should be in the procedure. And the output of the matrix to the screen in another procedure.
I do for now to enter the matrix. But not quite work.
Error: "Error 20: Variable identifier expected".
And points to the variable a
in the procedure. So I understand that for the variable b
will be the same situation.
I think that const
needs to be removed, because it is all the same constant, but I need a variable value. But then there is an error in the line
type mass = array [1..a,1..b] of integer;
Because a
and b
not defined.
Tell me, please, what to do. How to write correctly?
I would be very grateful if you write an example :)
That's what happened with me.
const a=10; b=10; type mass = array [1..a,1..b] of integer; var matr : mass; procedure zapolnenie_matricij; begin var i,j:integer; writeln('Введите параметр для строк: '); readln(a); writeln('Введите параметр для столбцов: '); readln(b); randomize; for i:=1 to a do begin for j:=1 to b do begin matr[i,j]=random(15); end; end; end;
If I try to write a
and b
as variables in the procedure, then the error "Error 113: Error in statement" appears.