Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Tau-function/XBasic/tau-function.basic
Normal file
24
Task/Tau-function/XBasic/tau-function.basic
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
PROGRAM "Tau"
|
||||
VERSION "0.0000"
|
||||
|
||||
DECLARE FUNCTION Entry ()
|
||||
DECLARE FUNCTION numdiv(n)
|
||||
|
||||
FUNCTION Entry ()
|
||||
PRINT "The tau functions for the first 100 positive integers are:\n"
|
||||
FOR i = 1 TO 100
|
||||
PRINT FORMAT$("###", numdiv(i));
|
||||
IF i MOD 10 = 0 THEN PRINT
|
||||
NEXT i
|
||||
END FUNCTION
|
||||
|
||||
FUNCTION numdiv(n)
|
||||
c = 1
|
||||
FOR i = 1 TO (n+1)\2
|
||||
IF n MOD i = 0 THEN INC c
|
||||
NEXT i
|
||||
IF n = 1 THEN DEC c
|
||||
RETURN c
|
||||
|
||||
END FUNCTION
|
||||
END PROGRAM
|
||||
Loading…
Add table
Add a link
Reference in a new issue