private { Private declarations } public { Public declarations } end;
var Form1: TForm1; tablica: array [0..29,0..9] of byte; implementation
{$R *.DFM}
procedure TForm1.b_wypelnijClick(Sender: TObject); var x,y:integer; begin for x:=0 to 30 do for y:=0 to 10 do begin tablica[x,y]:=random(101); sg1.cells[x,y]:=inttostr(tablica[x,y]); end; end;
procedure TForm1.b_sumujClick(Sender: TObject); var x,y,suma:integer; begin suma:=0; for x:=0 to 30 do for y:=0 to 10 do if (tablica[x,y]mod 2)=0 then suma:=suma+tablica[x,y]; e_suma.text:=inttostr(suma); end;