June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -0,0 +1,27 @@
|
|||
# Project : Self-describing numbers
|
||||
# Date : 2017/11/18
|
||||
# Author : Gal Zsolt (~ CalmoSoft ~)
|
||||
# Email : <calmosoft@gmail.com>
|
||||
|
||||
for num = 1 to 45000000
|
||||
res = 0
|
||||
for n=1 to len(string(num))
|
||||
temp = string(num)
|
||||
pos = number(temp[n])
|
||||
cnt = count(temp,string(n-1))
|
||||
if cnt = pos
|
||||
res = res + 1
|
||||
ok
|
||||
next
|
||||
if res = len(string(num))
|
||||
see num + nl
|
||||
ok
|
||||
next
|
||||
|
||||
func count(cString,dString)
|
||||
sum = 0
|
||||
while substr(cString,dString) > 0
|
||||
sum = sum + 1
|
||||
cString = substr(cString,substr(cString,dString)+len(string(sum)))
|
||||
end
|
||||
return sum
|
||||
Loading…
Add table
Add a link
Reference in a new issue