Advertisement
ProToTN

Untitled

Apr 12th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.59 KB | None | 0 0
  1. uses wincrt;
  2. Type Tab=Array[1..12] of integer;
  3. Var T:Tab;
  4.  
  5. Function Dist(X,i:Byte,T:Tab):Boolean;
  6. var j:byte;
  7. Begin
  8.   j:=1;
  9.   while (X<>T[j]) and (j<=i) do
  10.   Begin
  11.     j:=j+1;
  12.   End;
  13.   Dist:=(i=j);
  14. End;
  15.  
  16.  
  17. Procedure (Var T:Tab;N:Byte);
  18. Begin
  19.  Repeat
  20.     writeln('N');
  21.     readln(N);
  22.   Until N in [0..12];
  23.   For i:=1 to N do
  24.   Begin
  25.     Repeat
  26.       X:=random(140)+10;
  27.     Until Dist(X,i-1,T);
  28.     T[i]:=X;
  29.   End;
  30. End;
  31.  
  32.  
  33. Procedure  Tri(Var T:Tab;N:Byte);
  34. Begin
  35. End;
  36.  
  37.  
  38. Procedure Affichage(T:Tab;N:Byte);
  39. Begin
  40. End;
  41.  
  42. Begin
  43.   Remplissage(T,N);
  44.   Tri(T,N);
  45.   Affichage(T,N);
  46. End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement