Vous êtes sur la page 1sur 2

function puissance(a,b:integer):longint; function

var minimum(t:tab;n:integer):integer; function procedure saisie_tableau_trie(var


p:longint; var min,i:integer; palindrome(ch:string):boolean; t:tab;var n:integer);
i:integer; begin var i:integer; test:boolean; var
begin min:=t[1]; begin i:integer;
p:=1; for i:=2 to n do i:=0; begin
for i:=1 to b do if t[i]<min then repeat write('t[1]='); readln(t[1]);
p:=p*a; min:=t[i]; i:=i+1; for i:=2 to n do
puissance:=p; minimum:=min; if ch[i] = ch[length(ch)-i+1] then repeat
end; end; test:=true else test:=false; write('t[',i,']=');
until (test=false) or( i=length(ch) div 2); readln(t[i]);
function factoriel(a:integer) :longint; function palindrome:=test; until t[i]>t[i-1];
var majus_espace(ch:string):boolean; end; end;
f:longint; var
i:integer; i:integer; test:boolean; function function occurence(t:tab; n,x:integer)
begin begin distinct(t:tab;k:integer):boolean; :integer;
f:=1; i:=0; var i:integer; test:boolean; var
for i:=2 to a do repeat begin i,occ :integer;
f:=f*i; i:=i+1; i:=0; begin
factoriel:=f; if ch[i] in ['A'..'Z',' '] then test:=true repeat occ:=0;
end; else test:=false; i:=i+1; for i:=1 to n do
until (test=false) or (i=length(ch)); if t[i]=t[k] then test:=false if t[i]=x then occ:=occ+1;
function majus_espace:=test; else test:= true; occurence:=occ;
maximum(t:tab;n:integer):integer; end; until (test=false) or (i=k-1); end;
var distinct:=test;
max,i:integer; function end; function premier(n:integer):boolean;
begin exist(t:tab;n,x:integer):boolean; procedure saisie_distinct(var t:tab;var var
max:=t[1]; var i:integer; test:boolean; n:integer); i:integer;
for i:=2 to n do begin var i:integer; begin
if t[i]>max then i:=0; begin i:=2;
max:=t[i]; repeat write('t[1]='); readln(t[1]); while (n mod i <>0) and (i<=n div 2) do
maximum:=max; i:=i+1; for i:=2 to n do i:=i+1;
end; if t[i] =x then test:=true else test:=false; repeat if i > n div 2 then
until (test=true) or (i=n); write('t[',i,']='); readln(t[i]); premier:=true else premier:=false;
exist:=test; until distinct(t,i)=true; end;
end; end;
function premier(n:integer):boolean; Function Pgcd( a , b : integer) : integer; function ppcm(a,b:integer):integer;
var Var var Max,Min:integer;
i:integer; r : integer; begin
begin Begin Max := a; Min := b;
premier :=true ; While b <> 0 Do If b > Max Then
for i :=2 to n-1 do Begin Begin
if n mod i =0 then r := a mod b; Max := b;
premier:=false ; a := b; Min := a;
end; b := r; End;
End;
function recherchedichotomique Pgcd := a ; While Max Mod Min <> 0 Do
(t:tab;x:integer):boolean; end; Max := Max + (a + b - Min);
var ppcm := Max;
d,g,i:integer; end;
begin
procedure fact_premiers(var t1:tab;
g:=1; var k:integer;a:integer);
d:=n; var
repeat function
i:integer;
i:=(d+g) div 2; chaine_sans_redandance(ch:string):stri
if x<t[i] then d:=i-1 else g:=i+1; begin
ng;
until (x=t[i]) or (g>d); k:=0;
if x=t[i] then recherchedichotomique:=true var
i:=2;
else recherchedichotomique:=false; i,j:integer;
end; while a<>1 do chf :string ;
if a mod i =0 then begin
function pgcd(a,b:integer):integer; begin chf :=’’ ;
begin a:= a div i; for i:=1 to length(ch)-1 do
k:=k+1; if pos(ch[i]=chf)=0 then
while a <> b do
t1[k]:=i; chf :=chf+ch[i] ;
if a > b then a := a - b
end chaine_sans_redandance:=chf;
else b := b - a; end;
pgcd := a; else
end; i:=i+1;
end;