Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
48
Task/Attractive-numbers/Craft-Basic/attractive-numbers.basic
Normal file
48
Task/Attractive-numbers/Craft-Basic/attractive-numbers.basic
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
for x = 1 to 120
|
||||
|
||||
let n = x
|
||||
let c = 0
|
||||
|
||||
do
|
||||
|
||||
if int(n mod 2) = 0 then
|
||||
|
||||
let n = int(n / 2)
|
||||
let c = c + 1
|
||||
|
||||
endif
|
||||
|
||||
wait
|
||||
|
||||
loop int(n mod 2) = 0
|
||||
|
||||
for i = 3 to sqrt(n) step 2
|
||||
|
||||
do
|
||||
|
||||
if int(n mod i) = 0 then
|
||||
|
||||
let n = int(n / i)
|
||||
let c = c + 1
|
||||
|
||||
endif
|
||||
|
||||
wait
|
||||
|
||||
loop int(n mod i) = 0
|
||||
|
||||
next i
|
||||
|
||||
if n > 2 then
|
||||
|
||||
let c = c + 1
|
||||
|
||||
endif
|
||||
|
||||
if prime(c) then
|
||||
|
||||
print x, " ",
|
||||
|
||||
endif
|
||||
|
||||
next x
|
||||
Loading…
Add table
Add a link
Reference in a new issue