Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.58 KB | None | 0 0
  1. program zadanie13;
  2. uses crt;
  3. var i,x,z : byte;
  4.     porovnavac: boolean;
  5.         cislo: array[1..6] of integer;
  6.  
  7. begin
  8. clrscr;
  9. randomize;
  10. porovnavac:=false;
  11.  
  12. for i:=1 to 5 do
  13. begin
  14.  
  15.  
  16.  
  17.  
  18.  for x:=1 to 6 do
  19.  begin
  20.  
  21.   cislo[x]:=(random(34)+1);
  22.   for z:=1 to (x-1) do
  23.   begin
  24.  
  25.  
  26.    repeat
  27.     if cislo[x]=cislo[z] then
  28.      begin
  29.      porovnavac:=true;
  30.      cislo[x]:=(random(34)+1);
  31.      end
  32.     ELSE
  33.      begin
  34.      porovnavac:=false;
  35.      end;
  36.    until porovnavac=false;
  37.  
  38.  
  39.   end;
  40.  
  41.  
  42.   writeln(cislo[x]);
  43.  
  44.  end;
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52. writeln;
  53. end;
  54.  
  55. readln;
  56. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement