Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TForm1.Button1Click(Sender: TObject);
- var i,j, ilosc, ilosc2: integer;
- begin
- Label1.Caption:='';
- ilosc:=0;
- ilosc2:=0;
- for i:=1 to 4 do
- begin
- for j:=1 to 4 do
- begin
- tablica[i,j]:=RandomRange(2,10);
- end;
- end;
- for i:=1 to 5 do
- begin
- for j:=1 to 5 do
- begin
- //Skrajny
- if i=1 then
- begin
- if tablica[i,j]=2 then
- begin
- ilosc:=ilosc+1;
- end;
- if tablica[i,j]=6 then
- begin
- ilosc2:=ilosc2+1;
- end;
- end;
- //Skrajny
- if i=4 then
- if tablica[i,j]=2 then
- begin
- ilosc:=ilosc+1;
- end;
- if tablica[i,j]=6 then
- begin
- ilosc2:=ilosc2+1;
- end;
- end;
- end;
- Label1.Caption:='Znalazlem ' + IntToStr(ilosc) + ' dwójek i ' + IntToStr(ilosc2) + ' szóstek.';
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement