procedure Fibonnacci(n:integer);
procedure Intermediaire(n,a,b:integer);
begin
if n>0 then begin
writeln(a);
Intermediaire(n-1,b,a+b);
end;
end;
begin
if n<2 then writeln(1); // cas n=0 ou n=1
if n=1 then writeln(1); // cas n=1
if n>1 then Intermediaire(n+1,1,1);
end;
print "calcul du plus grand commun diviseur" input "combien de nombres voulez-vous comparer ";nb dim n(nb) maxi=0 for i=1 to nb print "entrez le nombre numero ";i input n(i) next i cls print "je recherche le pgcd de ces nombres..." sort n(, nb, 1 for i=1 to nb print n(i) next i nb1=n(1) nb2=n(2) gosub [pgcd] if nb>2 then for u=3 to nb nb1=pgcd nb2=n(u) gosub [pgcd] next u end if print "le pgcd est :" print pgcd input r$ end [pgcd] mini=min(nb1, nb2) maxi=max(nb1, nb2) ecart=maxi-mini if nb1*nb2=0 then pgcd=maxi goto [end.pgcd] end if while ecart<>0 scan maxi=max(ecart,mini) mini=min(ecart,mini) ecart=maxi-mini wend pgcd=maxi [end.pgcd] return
Vous n'aimez pas le lifting de Facebook ? Le site Mashable propose cinq étapes pour revenir à l'ancienne présentation du réseau social.