Answer the question
In order to leave comments, you need to log in
How in Pascal to create an array of the length that the user entered?
In general, what I need in Python looks like this:
n = int(input("Введите число: "))
a = [i for i in range(n)]
How to do this in Pascal? On the Internet, I was advised to simply declare the array in this way:
But something tells me that this is a bad form. Var a: array[1..999999] of integer;
Answer the question
In order to leave comments, you need to log in
Use dynamic array
var
a: array of integer;
begin
setlength(a, 10);
end;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question