LOVEGUN

Procedure Facteurs Premiers (Table)

Jan 1st, 2021
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.35 KB | None | 0 0
  1. Type
  2.   tab = Array [1..50] Of Integer;
  3.  
  4. Procedure facpremier (Var t:tab;n:Integer;Var j:Integer);
  5. Var
  6.   i: Integer;
  7.   ch: String;
  8.   x: String;
  9. Begin
  10.   i := 2;
  11.   j := 1;
  12.   Repeat
  13.     If n Mod i = 0 Then
  14.       Begin
  15.         t[j] := i;
  16.         j := j+1;
  17.         n := n Div i;
  18.       End
  19.     Else
  20.       i := i+1;
  21.   Until n=1;
  22.   j := j-1;
  23. End;
Advertisement
Add Comment
Please, Sign In to add comment