Var ma:array of array of integer; n,i,j:integer; begin readln(n); setlength(ma,n); for i:=0 to n-1 do setlength(ma[i],n); for i:=0 to n-1 do for j:=0 to n-i-1 do ma[i,j]:=i+j+1; for i:=0 to n-1 do begin for j:=0 to n-1 do write(ma[i,j]:4); writeln; end; end.
Answers & Comments
Verified answer
//Pascal ABC.NET v3.1 сборка 1219Var
ma:array of array of integer;
n,i,j:integer;
begin
readln(n);
setlength(ma,n);
for i:=0 to n-1 do
setlength(ma[i],n);
for i:=0 to n-1 do
for j:=0 to n-i-1 do
ma[i,j]:=i+j+1;
for i:=0 to n-1 do
begin
for j:=0 to n-1 do
write(ma[i,j]:4);
writeln;
end;
end.
Пример ввода:
5
Пример вывода:
1 2 3 4 5
2 3 4 5 0
3 4 5 0 0
4 5 0 0 0
5 0 0 0 0