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 6 do
- begin
- for j:=1 to 6 do
- begin
- if i=j then
- begin
- tablica[i,j]:=1;
- end;
- if i<>j then
- begin
- tablica[i,j]:=2;
- end;
- end;
- end;
- for i:=1 to 6 do
- begin
- for j:=1 to 6 do
- begin
- if tablica[i,j]=1 then
- begin
- ilosc:=ilosc+1;
- end;
- if tablica[i,j]=2 then
- begin
- ilosc2:=ilosc2+1;
- end;
- end;
- end;
- Label1.Caption:='Znalazlem ' + IntTOStr(ilosc) + ' jedynek i ' + IntToStr(ilosc2) + ' dwojek.';
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement