Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
20
Task/Factorions/FreeBASIC/factorions.basic
Normal file
20
Task/Factorions/FreeBASIC/factorions.basic
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
Dim As Integer fact(12), suma, d, j
|
||||
fact(0) = 1
|
||||
For n As Integer = 1 To 11
|
||||
fact(n) = fact(n-1) * n
|
||||
Next n
|
||||
For b As Integer = 9 To 12
|
||||
Print "Los factoriones para base " & b & " son: "
|
||||
For i As Integer = 1 To 1499999
|
||||
suma = 0
|
||||
j = i
|
||||
While j > 0
|
||||
d = j Mod b
|
||||
suma += fact(d)
|
||||
j \= b
|
||||
Wend
|
||||
If suma = i Then Print i & " ";
|
||||
Next i
|
||||
Print : Print
|
||||
Next b
|
||||
Sleep
|
||||
Loading…
Add table
Add a link
Reference in a new issue