SHARE
TWEET

Untitled

iyed May 25th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Program aa;
  2. Uses Wincrt;
  3. Type
  4. tab = Array[1..10] of Integer;
  5. var
  6. n:Integer;
  7. t:tab;
  8. Procedure readN(Var a:Integer);
  9. Begin
  10.   Repeat
  11.     writeln('Donnez la taille du tableau');
  12.     Readln(a);
  13.   Until a In [2..10];
  14. End;
  15.  
  16. Procedure fillArray(Var tt:tab;a:Integer);
  17. var i:Integer;
  18. Begin
  19.   For i:= 1 To a Do
  20.     Begin
  21.       Repeat
  22.         Writeln('T[',i,'] = ');
  23.         Readln(tt[i]);
  24.       Until (tt[i] >= 100) And (tt[i] <= 999);
  25.     End;
  26. End;
  27. Procedure afficher(tt:tab;a:Integer);
  28. var i:Integer;
  29. var counter:Integer;
  30. Begin
  31.         writeln('Les Nombres Proniques sont:');
  32.         For i:= 1 To a Do
  33.     Begin
  34.             counter := 0;
  35.       Repeat
  36.         counter := counter+1;
  37.       Until ((counter * (counter+1)) >= tt[i]);
  38.             if((counter * (counter+1)) = tt[i]) then writeln(tt[i]);
  39.     End;
  40. end;
  41.  
  42. Begin
  43.  
  44.  
  45.  
  46. readN(n);
  47. fillArray(t,n);
  48. afficher(t,n);
  49. End.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top