Вот: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 const n=5; var a: array[1..n,1..n] of integer; i,j,s: integer; begin s: =0; randomize; for i: =1 to n do begin for j: =1 to n do begin a[i,j]: =random(10); write(a[i,j]: 4); if (i+j) mod 3=0 then s: =s+a[i,j]; end; writeln; end; writeln('s=',s); end.
2) procedure TForm1.Button1Click(Sender: TObject);
var a: array[1..8] of integer; i:integer;
begin
for i := 1 to 8 do
a[i] := StrToInt(Memo1.Lines[i-1]);
Shape1.Height:=a[1];
Shape2.Height:=a[2];
Shape3.Height:=a[3];
Shape4.Height:=a[4];
Shape5.Height:=a[5];
Shape6.Height:=a[6];
Shape7.Height:=a[7];
Shape8.Height:=a[8];
end;
3) procedure TForm1.Button1Click(Sender: TObject);
var a: array [1..8] of real; b: array [1..8] of TShape; i: integer; min: real;
begin
for i := 1 to 8 do
a[i] := StrToInt(Memo1.Lines[i-1]);
min := a[1];
for i := 1 to 8 do
If a[i] < min Then min := a[i];
b[1] := Shape1; b[2] := Shape2; b[3] := Shape3; b[4] := Shape4;
b[5] := Shape5; b[6] := Shape6; b[7] := Shape7; b[8] := Shape8;
for i := 1 to 8 do
If a[i] = min Then b[i].Brush.Color:= clgreen else b[i].Brush.Color:= clgray;
end;