Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/M-bius-function/Tiny-BASIC/m-bius-function.basic
Normal file
20
Task/M-bius-function/Tiny-BASIC/m-bius-function.basic
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
PRINT "Enter an integer"
|
||||
INPUT N
|
||||
IF N < 0 THEN LET N = -N
|
||||
IF N < 2 THEN GOTO 100 + N
|
||||
LET C = 1
|
||||
LET F = 2
|
||||
10 IF ((N/F)/F)*F*F = N THEN GOTO 100
|
||||
IF (N/F)*F = N THEN GOTO 30
|
||||
20 LET F = F + 1
|
||||
IF F<=N THEN GOTO 10
|
||||
GOTO 100 + C
|
||||
30 LET N = N / F
|
||||
LET C = -C
|
||||
GOTO 20
|
||||
99 PRINT "-1"
|
||||
END
|
||||
100 PRINT "0"
|
||||
END
|
||||
101 PRINT "1"
|
||||
END
|
||||
Loading…
Add table
Add a link
Reference in a new issue