Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Bell-numbers/XPL0/bell-numbers.xpl0
Normal file
17
Task/Bell-numbers/XPL0/bell-numbers.xpl0
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
\Bell numbers
|
||||
code CrLf=9, IntOut=11, Text=12;
|
||||
define MaxIndex = 14;
|
||||
integer A(MaxIndex), I, J, N;
|
||||
|
||||
begin
|
||||
for I:= 0 to MaxIndex - 1 do A(I):= 0;
|
||||
N:= 0; A(0):= 1;
|
||||
Text(0, "B("); IntOut(0, N); Text(0, ") = "); IntOut(0, A(0)); CrLf(0);
|
||||
while N < MaxIndex do
|
||||
begin
|
||||
A(N):= A(0);
|
||||
for J:= N downto 1 do A(J - 1):= A(J - 1) + A(J);
|
||||
N:= N + 1;
|
||||
Text(0, "B("); IntOut(0, N); Text(0, ") = "); IntOut(0, A(0)); CrLf(0)
|
||||
end;
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue