Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
20
Task/Bell-numbers/Pascal-P/bell-numbers.pas
Normal file
20
Task/Bell-numbers/Pascal-P/bell-numbers.pas
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
program bellnums(output);
|
||||
(* Bell numbers *)
|
||||
const
|
||||
maxn = 14; (* with 32-bit integer *)
|
||||
var
|
||||
a: array[0..maxn - 1] of integer;
|
||||
i, j, n: integer;
|
||||
begin
|
||||
n := 0;
|
||||
for i := 0 to maxn - 1 do a[i] := 0;
|
||||
a[0] := 1;
|
||||
writeln('B(', n: 2, ') = ', a[0]: 9);
|
||||
while n < maxn do
|
||||
begin
|
||||
a[n] := a[0];
|
||||
for j := n downto 1 do a[j - 1] := a[j - 1] + a[j];
|
||||
n := n + 1;
|
||||
writeln('B(', n: 2, ') = ', a[0]: 9);
|
||||
end;
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue