Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
29
Task/Leonardo-numbers/PureBasic/leonardo-numbers.basic
Normal file
29
Task/Leonardo-numbers/PureBasic/leonardo-numbers.basic
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
EnableExplicit
|
||||
|
||||
#N = 25
|
||||
|
||||
Procedure leon_R(a.i, b.i, s.i = 1, n.i = #N)
|
||||
|
||||
If n>2
|
||||
Print(Space(1) + Str(a + b + s))
|
||||
ProcedureReturn leon_R(b, a + b + s, s, n-1)
|
||||
EndIf
|
||||
|
||||
EndProcedure
|
||||
|
||||
If OpenConsole()
|
||||
|
||||
Define r$
|
||||
|
||||
Print("Enter first two Leonardo numbers and increment step (separated by space) : ")
|
||||
r$ = Input()
|
||||
PrintN("First " + Str(#N) + " Leonardo numbers : ")
|
||||
Print(StringField(r$, 1, Chr(32)) + Space(1) +
|
||||
StringField(r$, 2, Chr(32)))
|
||||
|
||||
leon_R(Val(StringField(r$, 1, Chr(32))),
|
||||
Val(StringField(r$, 2, Chr(32))),
|
||||
Val(StringField(r$, 3, Chr(32))))
|
||||
|
||||
r$ = Input()
|
||||
EndIf
|
||||
Loading…
Add table
Add a link
Reference in a new issue