LOVEGUN

Fonction Facteurs Premiers

Jan 1st, 2021
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.34 KB | None | 0 0
  1. Function facpremier (n:Integer): String;
  2. Var
  3.   i: Integer;
  4.   ch: String;
  5.   x: String;
  6. Begin
  7.   i := 2;
  8.   ch := '';
  9.   Repeat
  10.     If n Mod i = 0 Then
  11.       Begin
  12.         Str (i,x);
  13.         ch := ch+x+'.';
  14.         n := n Div i;
  15.       End
  16.     Else
  17.       i := i+1;
  18.   Until n=1;
  19.   Delete (ch,Length(ch),1);
  20.   facpremier := ch;
  21. End;
Advertisement
Add Comment
Please, Sign In to add comment