Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. var i,j, ilosc, ilosc2: integer;
  3. begin
  4. Label1.Caption:='';
  5. ilosc:=0;
  6. ilosc2:=0;
  7. for i:=1 to 6 do
  8. begin
  9. for j:=1 to 6 do
  10. begin
  11. if i=j then
  12. begin
  13. tablica[i,j]:=1;
  14. end;
  15. if i<>j then
  16. begin
  17. tablica[i,j]:=2;
  18. end;
  19. end;
  20. end;
  21. for i:=1 to 6 do
  22. begin
  23. for j:=1 to 6 do
  24. begin
  25. if tablica[i,j]=1 then
  26. begin
  27. ilosc:=ilosc+1;
  28. end;
  29. if tablica[i,j]=2 then
  30. begin
  31. ilosc2:=ilosc2+1;
  32. end;
  33. end;
  34. end;
  35. Label1.Caption:='Znalazlem ' + IntTOStr(ilosc) + ' jedynek i ' + IntToStr(ilosc2) + ' dwojek.';
  36. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement