Accueil     Soft. MacOSX     Soft. MacOS/PC     PHP     Python     ROMS GBA     TP d'info     DBZ-GT     Martingales     Galeries     Liens     @  

Exercice 1 ab

program recursion_n_p_q;
var
i, j, k: integer;

function f (n, p, q: integer): integer;
begin
f := 0; { initialiser le compteur }
if (n <> p) and (sqr(n) < q) then
f := 1 + f(n + 1, p, q);
end;
{ Fin de 'f' }

begin
writeln('Exercice 3 b');
writeln;
writeln('Le programme va afficher le nombre d''entiers compris');
writeln('entre ''n'' et ''p'' dont le carré est inférieure à ''q''');
writeln;
writeln('n=');
readln(i);
repeat
writeln('p=');
readln(j);
until j > i;
repeat
writeln('q=');
readln(k);
until sqr(i) <= k;

writeln('Le résultat est: ', f(i, j, k) : 0);
writeln;
writeln('©2001 All Rights Reserved to www.Software-DS.com');
{ ©2001 All Rights Reserved to http://www.Software-DS.com 06/11/01 }
end.





Haut de la page - Page précédente - Page générée en 0.00203 sec.
Recherche personnalisée
 

1843781 visiteurs.   ©2001-2023 All Rights Reserved to Software-DS.com
Made with a mac  
Confidentialité