Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
23
Task/Multifactorial/QuickBASIC/multifactorial.basic
Normal file
23
Task/Multifactorial/QuickBASIC/multifactorial.basic
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
' Multi factorial
|
||||
|
||||
DECLARE FUNCTION MultiFactorial& (N%, Degree%)
|
||||
FOR Degree% = 1 TO 5
|
||||
PRINT "Degree"; Degree%; "=>";
|
||||
FOR N% = 1 TO 10
|
||||
PRINT MultiFactorial&(N%, Degree%);
|
||||
NEXT N%
|
||||
PRINT
|
||||
NEXT Degree%
|
||||
END
|
||||
|
||||
FUNCTION MultiFactorial& (N%, Degree%)
|
||||
IF (N% < 2) THEN
|
||||
MultiFactorial& = 1
|
||||
ELSE
|
||||
Result& = N%
|
||||
FOR I% = N% - Degree% TO 2 STEP -Degree%
|
||||
Result& = Result& * I%
|
||||
NEXT I%
|
||||
MultiFactorial& = Result&
|
||||
END IF
|
||||
END FUNCTION
|
||||
Loading…
Add table
Add a link
Reference in a new issue