Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,19 @@
with Ada.Text_IO; use Ada.Text_IO;
procedure Sudan_Function is
function F (N, X, Y : Natural) return Natural
is (if N = 0 then X + Y
elsif Y = 0 then X
else F (N => N - 1,
X => F (N, X, Y - 1),
Y => F (N, X, Y - 1) + Y));
begin
Put_Line ("F0 (0, 0) = " & F (0, 0, 0)'Image);
Put_Line ("F1 (1, 1) = " & F (1, 1, 1)'Image);
Put_Line ("F1 (3, 3) = " & F (1, 3, 3)'Image);
Put_Line ("F2 (1, 1) = " & F (2, 1, 1)'Image);
Put_Line ("F2 (2, 1) = " & F (2, 2, 1)'Image);
Put_Line ("F3 (1, 1) = " & F (3, 1, 1)'Image);
end Sudan_Function;