Compiling the program is successful, after entering data into the variable n, the program abruptly terminates. With what it can be connected?

program l3p4; {$APPTYPE CONSOLE} {$CODEPAGE UTF8} var a: array of array of real; n,sum,i,j: integer; begin randomize; write('Введите n: '); read(n); SetLength(a,n,n); for i:=1 to n-1 do begin for j:=1 to n-1 do begin a[i,j]:=random(100); write(a[i,j]:5:2,' '); end; writeln; end; readln; end. 
  • It seems to work: ideone.com/XEXosa - Harry
  • There are no errors visible, except that array indices start from 0, and not from 1 by default. - Alekcvp

1 answer 1

The problem is solved, it was necessary to change read (n) to readln (n). The last readln statement reads Enter and closes the program.