Data update
This commit is contained in:
parent
72eb4943cb
commit
4d5544505c
2347 changed files with 62432 additions and 16731 deletions
|
|
@ -0,0 +1,23 @@
|
|||
100 sub factorial(n)
|
||||
110 if n < 1 then factorial = 1
|
||||
120 product = 1
|
||||
130 for i = 2 to n
|
||||
140 product = product*i
|
||||
150 next
|
||||
160 factorial = product
|
||||
170 end sub
|
||||
180 sub binomial(n,k)
|
||||
190 if n < 0 or k < 0 or n <= k then binomial = 1
|
||||
200 product = 1
|
||||
210 for i = n-k+1 to n
|
||||
220 product = product*i
|
||||
230 next
|
||||
240 binomial = int(product/factorial(k))
|
||||
250 end sub
|
||||
260 for n = 0 to 14
|
||||
270 for k = 0 to n
|
||||
280 print using " ####"; binomial(n,k);
|
||||
290 next k
|
||||
300 print
|
||||
310 next n
|
||||
320 end
|
||||
Loading…
Add table
Add a link
Reference in a new issue