Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,23 @@
' FB 1.05.0 Win64
Function selfDescribing (n As UInteger) As Boolean
If n = 0 Then Return False
Dim ns As String = Str(n)
Dim count(0 To 9) As Integer '' all elements zero by default
While n > 0
count(n Mod 10) += 1
n \= 10
Wend
For i As Integer = 0 To Len(ns) - 1
If ns[i] - 48 <> count(i) Then Return False '' numerals have ascii values from 48 to 57
Next
Return True
End Function
Print "The self-describing numbers less than 100 million are:"
For i As Integer = 0 To 99999999
If selfDescribing(i) Then Print i; " ";
Next
Print
Print "Press any key to quit"
Sleep