Acasa Tehnologie Functia Manna Pnueli recursiv

Functia Manna Pnueli recursiv

by Dragos Schiopu

programare

Functia Manna Pnueli recursiv

>

program manna_pnueli;
var x:integer;

function manna(x:integer):integer;
begin
if x>=12 then manna:=x-1
else
manna:=manna(manna(x+2));
end;

begin
write('x=');readln(x);
writeln(manna(x));
readln;
end.
{PascalZone.uv.ro}

s-ar putea sa-ti placa