Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -0,0 +1,21 @@
DECLARE
FUNCTION ackermann(pi_m IN NUMBER,
pi_n IN NUMBER) RETURN NUMBER IS
BEGIN
IF pi_m = 0 THEN
RETURN pi_n + 1;
ELSIF pi_n = 0 THEN
RETURN ackermann(pi_m - 1, 1);
ELSE
RETURN ackermann(pi_m - 1, ackermann(pi_m, pi_n - 1));
END IF;
END ackermann;
BEGIN
FOR n IN 0 .. 6 LOOP
FOR m IN 0 .. 3 LOOP
dbms_output.put_line('A(' || m || ',' || n || ') = ' || ackermann(m, n));
END LOOP;
END LOOP;
END;