Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 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 5 do
  8. begin
  9. for j:=1 to 5 do
  10. begin
  11. tablica[i,j]:=RandomRange(2,20);
  12. end;
  13. end;
  14. for i:=1 to 5 do
  15. begin
  16. for j:=1 to 5 do
  17. begin
  18. if i>j then
  19. if tablica[i,j]=6 then
  20. begin
  21. ilosc:=ilosc+1;
  22. end;
  23. if tablica[i,j]=10 then
  24. begin
  25. ilosc2:=ilosc2+1;
  26. end;
  27. end;
  28. end;
  29.  
  30. Label1.Caption:='Znalazlem ' + IntToStr(ilosc) + ' szóstek i ' + IntToStr(ilosc2) + ' dziesiatek.';
  31.  
  32. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement