надо что бы матрица выводила
Код:
1 2 .. n
....................
(n-2) (n-1) n
(n-1) n n
procedure TForm8.Button1Click(Sender: TObject);
var i,k,j,n,t:byte;
s: string;
begin
StringGrid1.Visible:=True;
n:=StrToInt(edit1.Text);
StringGrid1.ColCount:=n;
StringGrid1.RowCount:=n;
begin
for j:=0 to n-1 do
StringGrid1.Cells[j,0]:=inttostr(j+1); { 1 линия }
end;
begin
for i:=0 to n do
for j:=0 to n-1 do
if i+j > n then
begin
StringGrid1.Cells[i,j]:=inttostr(n);
end
else
StringGrid1.Cells[j,i]:=inttostr(i+j-1);
end;
end;
Админ: Пользуемся тегами для оформления кода!
у меня выводит фигню. Исправите ,пожалуйста ошибку